/* * pHatt - PalmOS(TM) Hattrick (http://www.hattrick.org) Manager Assistant * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ int valueInCurrency(int v, unsigned int country) { switch (country) { case Country_Chile: return 20 * v; case Country_Nippon: case Country_Island: return 10 * v; case Country_Pakistan: case Country_Slovakia: return 5 * v; case Country_India: case Country_Thai: case Country_Rossiya: case Country_Ceska: case Country_Pilipinas: return 4 * v; case Country_Romania: case Country_Eesti: return 2 * v; case Country_Sverige: case Country_Norge: case Country_Danmark: case Country_Colombia: case Country_China: case Country_Uruguay: case Country_Mexico: case Country_Indonesia: case Country_Srbija: case Country_Hrvatska: case Country_HongKong: case Country_Vietnam: return v; case Country_SthAfrica: return 4 * v / 5; case Country_Israel: case Country_Ukraina: return v / 2; case Country_Lietuva: case Country_Polska: case Country_Egypt: case Country_Malaysia: return 2 * v / 5; case Country_Oceania: case Country_Brasil: case Country_Canada: case Country_Schweiz: case Country_Singapore: case Country_Bulgaria: case Country_Bosnia: return v / 5; case Country_Deutschland: case Country_Italia: case Country_France: case Country_Suomi: case Country_Nederland: case Country_Ireland: case Country_Espana: case Country_Oesterreich: case Country_Belgie: case Country_Portugal: case Country_Slovenija: case Country_Hellas: case Country_Argentina: case Country_Peru: case Country_USA: case Country_Taiwan: case Country_Venezuela: case Country_Korea: case Country_Turkiye: return v / 10; case Country_Scotland: case Country_Wales: case Country_England: return v / 15; case Country_Latvija: return v / 20; case Country_Hungary: return v / 50; default: return v; } } int currencyToKroner(int v, unsigned int country) { switch (country) { case Country_Chile: return v / 20; case Country_Nippon: case Country_Island: return v / 10; case Country_Pakistan: case Country_Slovakia: return v / 5; case Country_India: case Country_Thai: case Country_Rossiya: case Country_Ceska: case Country_Pilipinas: return v / 4; case Country_Romania: case Country_Eesti: return v / 2; case Country_Sverige: case Country_Norge: case Country_Danmark: case Country_Colombia: case Country_China: case Country_Uruguay: case Country_Mexico: case Country_Indonesia: case Country_Srbija: case Country_Hrvatska: case Country_HongKong: case Country_Vietnam: return v; case Country_SthAfrica: return 5 * v / 4; case Country_Israel: case Country_Ukraina: return 2 * v; case Country_Lietuva: case Country_Polska: case Country_Egypt: case Country_Malaysia: return 5 * v / 2; case Country_Oceania: case Country_Brasil: case Country_Canada: case Country_Schweiz: case Country_Singapore: case Country_Bulgaria: case Country_Bosnia: return 5 * v; case Country_Deutschland: case Country_Italia: case Country_France: case Country_Suomi: case Country_Nederland: case Country_Ireland: case Country_Espana: case Country_Oesterreich: case Country_Belgie: case Country_Portugal: case Country_Slovenija: case Country_Hellas: case Country_Argentina: case Country_Peru: case Country_USA: case Country_Taiwan: case Country_Venezuela: case Country_Korea: case Country_Turkiye: return 10 * v; case Country_Scotland: case Country_Wales: case Country_England: return 15 * v; case Country_Latvija: return 20 * v; case Country_Hungary: return 50 * v; default: return v; } }