]>
Dogcows Code - chaz/homebank/blob - src/hb-currency.c
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2018 Maxime DOYEN
4 * This file is part of HomeBank.
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * HomeBank is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "hb-currency.h"
24 #include <libsoup/soup.h>
30 /****************************************************************************/
32 /****************************************************************************/
42 /* our global datas */
43 extern struct HomeBank
*GLOBALS
;
44 extern struct Preferences
*PREFS
;
46 extern Currency4217 iso4217cur
[];
47 extern guint n_iso4217cur
;
50 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
53 da_cur_free(Currency
*item
)
55 DB( g_print("da_cur_free\n") );
58 DB( g_print(" => %d, %s\n", item
->key
, item
->iso_code
) );
61 g_free(item
->iso_code
);
63 g_free(item
->decimal_char
);
64 g_free(item
->grouping_char
);
74 DB( g_print("da_cur_malloc\n") );
75 return g_malloc0(sizeof(Currency
));
82 DB( g_print("da_cur_destroy\n") );
83 g_hash_table_destroy(GLOBALS
->h_cur
);
91 DB( g_print("da_cur_new\n") );
92 GLOBALS
->h_cur
= g_hash_table_new_full(g_int_hash
, g_int_equal
, (GDestroyNotify
)g_free
, (GDestroyNotify
)da_cur_free
);
94 // insert default base currency
95 curfmt
= iso4217format_get(PREFS
->IntCurrSymbol
);
97 curfmt
= iso4217format_get("USD");
101 DB( g_printf("curfmt %p\n", curfmt
) );
103 currency_add_from_user(curfmt
);
108 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
109 static void da_cur_max_key_ghfunc(gpointer key
, Currency
*item
, guint32
*max_key
)
111 *max_key
= MAX(*max_key
, item
->key
);
114 static gboolean
da_cur_name_grfunc(gpointer key
, Currency
*item
, gchar
*name
)
116 if( name
&& item
->name
)
118 if(!strcasecmp(name
, item
->name
))
124 static gboolean
da_cur_iso_grfunc(gpointer key
, Currency
*item
, gchar
*iso
)
126 if( iso
&& item
->iso_code
)
128 if(!strcasecmp(iso
, item
->iso_code
))
137 return g_hash_table_size(GLOBALS
->h_cur
);
141 da_cur_remove(guint32 key
)
143 DB( g_print("da_cur_remove %d\n", key
) );
145 return g_hash_table_remove(GLOBALS
->h_cur
, &key
);
150 da_cur_init_from4217(Currency
*cur
, Currency4217
*curfmt
)
152 cur
->symbol
= g_strdup(curfmt
->curr_symbol
);
153 cur
->sym_prefix
= curfmt
->curr_is_prefix
;
154 cur
->decimal_char
= g_strdup(curfmt
->curr_dec_char
);
155 cur
->grouping_char
= g_strdup(curfmt
->curr_grp_char
);
156 cur
->frac_digits
= curfmt
->curr_frac_digit
;
157 da_cur_initformat(cur
);
162 da_cur_initformat(Currency
*item
)
164 DB( g_print("init currency %s, %d \n", item
->symbol
, item
->frac_digits
) );
167 g_snprintf(item
->format
, 8-1, "%%.%df", item
->frac_digits
);
169 if(item
->sym_prefix
== TRUE
)
170 g_snprintf(item
->monfmt
, 32-1, "%s %%s", item
->symbol
);
172 g_snprintf(item
->monfmt
, 32-1, "%%s %s", item
->symbol
);
174 DB( g_print("fmt '%s'\n", item
->format
) );
175 DB( g_print("monfmt '%s'\n", item
->monfmt
) );
180 da_cur_insert(Currency
*item
)
184 DB( g_print("da_cur_insert\n") );
186 new_key
= g_new0(guint32
, 1);
187 *new_key
= item
->key
;
188 g_hash_table_insert(GLOBALS
->h_cur
, new_key
, item
);
190 da_cur_initformat(item
);
197 da_cur_append(Currency
*item
)
202 DB( g_print("da_cur_append\n") );
204 /* ensure no duplicate */
205 existitem
= da_cur_get_by_name( item
->name
);
206 if( existitem
== NULL
)
208 new_key
= g_new0(guint32
, 1);
209 *new_key
= da_cur_get_max_key() + 1;
210 item
->key
= *new_key
;
211 //item->pos = da_cur_length() + 1;
213 DB( g_print(" -> insert id: %d\n", *new_key
) );
215 g_hash_table_insert(GLOBALS
->h_cur
, new_key
, item
);
217 da_cur_initformat(item
);
222 DB( g_print(" -> %s already exist: %d\n", item
->iso_code
, item
->key
) );
229 da_cur_get_max_key(void)
233 g_hash_table_foreach(GLOBALS
->h_cur
, (GHFunc
)da_cur_max_key_ghfunc
, &max_key
);
239 da_cur_get_by_name(gchar
*name
)
241 DB( g_print("da_cur_get_by_name\n") );
243 return g_hash_table_find(GLOBALS
->h_cur
, (GHRFunc
)da_cur_name_grfunc
, name
);
248 da_cur_get_by_iso_code(gchar
*iso_code
)
250 DB( g_print("da_cur_get_by_iso_code\n") );
252 return g_hash_table_find(GLOBALS
->h_cur
, (GHRFunc
)da_cur_iso_grfunc
, iso_code
);
256 da_cur_get(guint32 key
)
258 //DB( g_print("da_cur_get\n") );
260 return g_hash_table_lookup(GLOBALS
->h_cur
, &key
);
267 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
272 * controls if a currency is used [base or account]
274 * Return value: TRUE if used, FALSE, otherwise
277 currency_is_used(guint32 key
)
282 if(GLOBALS
->kcur
== key
)
287 list
= g_hash_table_get_values(GLOBALS
->h_acc
);
290 Account
*item
= list
->data
;
292 if(item
->kcur
== key
)
297 list
= g_list_next(list
);
308 Currency4217
*iso4217format_get(gchar
*code
)
313 for (i
= 0; i
< n_iso4217cur
; i
++)
315 cur
= &iso4217cur
[i
];
316 if(g_strcmp0(cur
->curr_iso_code
, code
) == 0)
325 static void currency_get_system_format(Currency
*item
)
327 DB( g_printf("\n[(currency] get format from system '%s'\n", item
->iso_code
) );
332 struct lconv
*lc
= localeconv();
334 DB( g_print("int_curr_symbol '%s'\n", lc
->int_curr_symbol
) );
336 DB( g_print("mon_decimal_point is utf8: %d\n", g_utf8_validate(lc
->mon_decimal_point
, -1, NULL
)) );
337 DB( g_print("mon_decimal_point '%s'\n", lc
->mon_decimal_point
) );
338 DB( g_print("mon_decimal_point %x %x %x %x\n", lc
->mon_decimal_point
[0], lc
->mon_decimal_point
[1], lc
->mon_decimal_point
[2], lc
->mon_decimal_point
[3]) );
340 DB( g_print("mon_thousands_sep is utf8: %d\n", g_utf8_validate(lc
->mon_thousands_sep
, -1, NULL
)) );
341 DB( g_print("mon_thousands_sep '%s'\n", lc
->mon_thousands_sep
) );
342 DB( g_print("mon_thousands_sep %x %x %x %x\n", lc
->mon_thousands_sep
[0], lc
->mon_thousands_sep
[1], lc
->mon_thousands_sep
[2], lc
->mon_thousands_sep
[3]) );
345 DB( g_print("frac_digits '%d'\n", (gint
)lc
->frac_digits
) );
347 DB( g_print("currency_symbol '%s'\n", lc
->currency_symbol
) );
349 DB( g_print("p_cs_precedes '%d'\n", lc
->p_cs_precedes
) );
351 DB( g_print("n_cs_precedes '%d'\n", lc
->n_cs_precedes
) );
354 item
->symbol
= g_strdup(lc
->currency_symbol
);
356 if( lc
->p_cs_precedes
|| lc
->n_cs_precedes
)
358 item
->sym_prefix
= TRUE
;
359 DB( g_print("locale mon cs is a prefix\n") );
363 item
->sym_prefix
= FALSE
;
366 item
->decimal_char
= g_strdup(lc
->mon_decimal_point
);
368 item
->grouping_char
= g_strdup(lc
->mon_thousands_sep
);
371 //PREFS->base_cur.grouping_char = g_locale_to_utf8(lc->mon_thousands_sep, -1, NULL, NULL, NULL);
372 //PREFS->base_cur.grouping_char = g_convert (lc->mon_thousands_sep, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
374 DB( g_print(" -> grouping_char: '%s'\n", item
->grouping_char
) );
376 item
->frac_digits
= lc
->frac_digits
;
379 if( item
->frac_digits
> MAX_FRAC_DIGIT
)
381 item
->frac_digits
= 2;
382 g_free(item
->decimal_char
);
383 item
->decimal_char
= g_strdup(".");
388 #define BUFFER_SIZE 512
389 char buffer
[BUFFER_SIZE
];
390 //LPWSTR wcBuffer = buffer;
391 LPSTR wcBuffer
= buffer
;
394 //https://msdn.microsoft.com/en-us/library/windows/desktop/dd464799%28v=vs.85%29.aspx
396 //see g_locale_to_utf8 here
397 iResult
= GetLocaleInfoA(LOCALE_USER_DEFAULT
, LOCALE_SCURRENCY
, wcBuffer
, BUFFER_SIZE
);
400 DB( g_print("LOCALE_SCURRENCY='%s'\n", buffer
) );
401 item
->symbol
= g_locale_to_utf8(buffer
, -1, NULL
, NULL
, NULL
);
404 item
->sym_prefix
= FALSE
;
405 iResult
= GetLocaleInfoA(LOCALE_USER_DEFAULT
, LOCALE_IPOSSYMPRECEDES
, wcBuffer
, BUFFER_SIZE
);
408 DB( g_print("LOCALE_IPOSSYMPRECEDES='%s'\n", buffer
) );
409 //todo item->sym_prefix
413 iResult
= GetLocaleInfoA(LOCALE_USER_DEFAULT
, LOCALE_SDECIMAL
, wcBuffer
, BUFFER_SIZE
);
416 DB( g_print("LOCALE_SDECIMAL='%s'\n", buffer
) );
417 item
->decimal_char
= g_locale_to_utf8(buffer
, -1, NULL
, NULL
, NULL
);
420 iResult
= GetLocaleInfoA(LOCALE_USER_DEFAULT
, LOCALE_STHOUSAND
, wcBuffer
, BUFFER_SIZE
);
423 DB( g_print("LOCALE_STHOUSAND='%s'\n", buffer
) );
424 item
->grouping_char
= g_locale_to_utf8(buffer
, -1, NULL
, NULL
, NULL
);
427 iResult
= GetLocaleInfoA(LOCALE_USER_DEFAULT
, LOCALE_ICURRDIGITS
, wcBuffer
, BUFFER_SIZE
);
430 DB( g_print("LOCALE_ICURRDIGITS='%s'\n", buffer
) );
431 item
->frac_digits
= atoi(buffer
);
434 item
->frac_digits
= 2;
443 Currency
*currency_add_from_user(Currency4217
*curfmt
)
447 DB( g_printf("\n[(currency] found adding %s\n", curfmt
->curr_iso_code
) );
449 item
= da_cur_malloc();
454 item
->name
= g_strdup(curfmt
->name
);
455 //item->country = cur.country_name;
456 item
->iso_code
= g_strdup(curfmt
->curr_iso_code
);
458 //1634615 if the currency match the system, fill with it
459 if(!strcmp(item
->iso_code
, PREFS
->IntCurrSymbol
))
461 currency_get_system_format(item
);
465 item
->frac_digits
= curfmt
->curr_frac_digit
;
466 item
->symbol
= g_strdup(curfmt
->curr_symbol
);
467 item
->sym_prefix
= curfmt
->curr_is_prefix
;
468 item
->decimal_char
= g_strdup(curfmt
->curr_dec_char
);
469 item
->grouping_char
= g_strdup(curfmt
->curr_grp_char
);
474 item
->name
= g_strdup("unknow");
475 //item->country = cur.country_name;
476 item
->iso_code
= g_strdup("XXX");
477 item
->frac_digits
= 2;
478 item
->symbol
= g_strdup("XXX");
479 item
->sym_prefix
= FALSE
;
480 item
->decimal_char
= g_strdup(".");
481 item
->grouping_char
= NULL
;
490 static gboolean
currency_rate_update(gchar
*isocode
, gdouble rate
, guint32 date
)
492 gboolean retval
= FALSE
;
495 cur
= da_cur_get_by_iso_code (isocode
);
498 DB( g_print(" found cur='%s'\n", cur
->iso_code
) );
501 GLOBALS
->changes_count
++;
509 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
514 gchar fixeriojson[] =
516 " { \r \"base\" : \"EUR\", \
517 \"date\": \n\r \"2017-12-04\", \
518 \"rates\" \n\n :{\"AUD\":1.5585,\"CAD\":1.5034,\"CHF\":1.1665,\"CNY\":7.8532,\"GBP\":0.87725,\"JPY\":133.91,\"USD\":1.1865 \
523 static gboolean
api_fixerio_parse(const gchar
*body
, GError
**error
)
530 guint32 date
= GLOBALS
->today
;
535 //there is no need of a complex JSON parser here, so let's hack !
536 rawjson
= g_strdup(body
);
537 hb_string_inline(rawjson
);
539 DB( g_printf("\nbody: '%s'\n", rawjson
) );
542 p
= g_strstr_len(rawjson
, -1, "\"date\"");
545 strncpy(strbuf
, p
+8, 10);
547 date
= hb_date_get_julian(strbuf
, PRF_DATEFMT_YMD
);
548 DB( g_printf("\n-date: %.10s %d\n", strbuf
, date
) );
552 p
= g_strstr_len(rawjson
, -1, "\"rates\"");
558 p
= hb_string_copy_jsonpair(strbuf
, p
);
559 strncpy(isocode
, strbuf
, 3);
561 rate
= g_ascii_strtod(strbuf
+4, NULL
);
562 DB( g_printf("\npair: '%s' '%s' %f\n", strbuf
, isocode
, rate
) );
564 if( currency_rate_update(isocode
, rate
, date
) )
574 return( (count
> 0) ? TRUE
: FALSE
);
578 static gchar
*api_fixerio_query_build(void)
586 base
= da_cur_get (GLOBALS
->kcur
);
588 node
= g_string_sized_new(512);
589 g_string_append_printf(node
, "https://api.fixer.io/latest?base=%s&symbols=", base
->iso_code
);
591 list
= g_hash_table_get_values(GLOBALS
->h_cur
);
592 i
= g_list_length (list
);
597 if( (item
->key
!= GLOBALS
->kcur
) && (strlen(item
->iso_code
) == 3) )
599 g_string_append_printf(node
, "%s", item
->iso_code
);
602 g_string_append(node
, ",");
606 list
= g_list_next(list
);
610 return g_string_free(node
, FALSE
);
614 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
617 gboolean
currency_online_sync(GError
**error
)
619 SoupSession
*session
;
622 gboolean retval
= TRUE
;
624 DB( g_printf("\n[currency] sync online\n") );
626 query
= api_fixerio_query_build();
627 DB( g_printf("query: '%s'\n", query
) );
631 retval = api_fixerio_parse(fixeriojson, error);
634 session
= soup_session_new ();
635 msg
= soup_message_new ("GET", query
);
638 soup_session_send_message (session
, msg
);
639 DB( g_print("status_code: %d %d\n", msg
->status_code
, SOUP_STATUS_IS_SUCCESSFUL(msg
->status_code
) ) );
640 DB( g_print("reason: %s\n", msg
->reason_phrase
) );
641 DB( g_print("datas: %s\n", msg
->response_body
->data
) );
643 if( SOUP_STATUS_IS_SUCCESSFUL(msg
->status_code
) == TRUE
)
645 retval
= api_fixerio_parse(msg
->response_body
->data
, error
);
646 //retval = api_yahoo_parse(msg->response_body->data, error);
650 *error
= g_error_new_literal(1, msg
->status_code
, msg
->reason_phrase
);
656 *error
= g_error_new_literal(1, 0, "cannot parse URI");
666 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
669 //struct iso_4217_currency iso_4217_currencies[];
672 static void fill_currency(void)
675 struct iso_4217_currency cur;
678 for (i = 0; i< 500; i++)
680 cur = iso_4217_currencies[i];
682 if(cur.iso_code == NULL)
685 item = da_cur_malloc();
688 item->name = cur.currency;
689 item->country = cur.country;
690 item->iso_code = cur.iso_code;
700 Currency4217 iso4217cur
[] =
702 { "AED", 2, ".", ",", TRUE
, "د.إ.", "UAE Dirham" },
703 { "AFN", 0, ",", ",", TRUE
, "؋", "Afghani" },
704 { "ALL", 0, ",", " ", FALSE
, "Lekë", "Lek" },
705 { "AMD", 2, ".", ",", FALSE
, "֏", "Armenian Dram" },
706 { "ANG", 2, ",", ",", TRUE
, "NAf.", "Netherlands Antillian Guilder" },
707 { "AOA", 2, ",", " ", FALSE
, "Kz", "Kwanza" },
708 { "ARS", 2, ",", ".", TRUE
, "$", "Argentine Peso" },
709 { "AUD", 2, ".", ",", TRUE
, "$", "Australian Dollar" },
710 { "AWG", 2, ",", ".", TRUE
, "Afl.", "Aruban Guilder" },
711 { "AZN", 2, ",", " ", TRUE
, "₼", "Azerbaijanian Manat" },
712 { "BAM", 2, ",", ".", FALSE
, "KM", "Convertible Marks" },
713 { "BBD", 2, ".", ",", TRUE
, "$", "Barbados Dollar" },
714 { "BDT", 2, ".", ",", TRUE
, "৳", "Taka" },
715 { "BGN", 2, ",", " ", FALSE
, "лв.", "Bulgarian Lev" },
716 { "BHD", 3, ".", ",", TRUE
, "د.ب.", "Bahraini Dinar" },
717 { "BIF", 0, ",", " ", FALSE
, "FBu", "Burundi Franc" },
718 { "BMD", 2, ".", ",", TRUE
, "$", "Bermudian Dollar" },
719 { "BND", 2, ",", ".", TRUE
, "$", "Brunei Dollar" },
720 { "BOB", 2, ",", ".", TRUE
, "Bs", "Boliviano" },
721 { "BOV", 2, ".", "", FALSE
, "BOV", "Mvdol" },
722 { "BRL", 2, ",", ".", TRUE
, "R$", "Brazilian Real" },
723 { "BSD", 2, ".", ",", TRUE
, "$", "Bahamian Dollar" },
724 { "BTN", 2, ".", ",", TRUE
, "Nu.", "Ngultrum" },
725 { "BWP", 2, ".", " ", TRUE
, "P", "Pula" },
726 { "BYN", 0, ",", " ", FALSE
, "Br", "Belarussian Ruble" },
727 { "BYR", 0, ",", " ", FALSE
, "Br", "Old Belarussian Ruble" },
728 { "BZD", 2, ".", ",", TRUE
, "$", "Belize Dollar" },
729 { "CAD", 2, ",", " ", TRUE
, "$", "Canadian Dollar" },
730 { "CDF", 2, ",", " ", TRUE
, "FC", "Congolese Franc" },
731 { "CHE", 2, ".", "", FALSE
, "CHE", "WIR Euro" },
732 { "CHF", 2, ",", "'", TRUE
, "CHF", "Swiss Franc" },
733 { "CHW", 2, ".", "", FALSE
, "CHW", "WIR Franc" },
734 { "CLF", 2, ".", "", FALSE
, "CLF", "Unidades de fomento" },
735 { "CLP", 0, ",", ".", TRUE
, "$", "Chilean Peso" },
736 { "CNY", 2, ".", ",", TRUE
, "¥", "Yuan Renminbi" },
737 { "COP", 0, ",", ".", TRUE
, "$", "Colombian Peso" },
738 { "COU", 2, ".", "", FALSE
, "COU", "Unidad de Valor Real" },
739 { "CRC", 0, ",", ".", TRUE
, "₡", "Costa Rican Colon" },
740 { "CUP", 2, ".", ",", TRUE
, "$", "Cuban Peso" },
741 { "CVE", 2, "$", " ", FALSE
, "", "Cape Verde Escudo" },
742 { "CYP", 2, ".", "", FALSE
, "CYP", "Cyprus Pound" },
743 { "CZK", 2, ",", " ", FALSE
, "Kč", "Czech Koruna" },
744 { "DJF", 0, ",", " ", TRUE
, "Fdj", "Djibouti Franc" },
745 { "DKK", 2, ",", ".", TRUE
, "kr", "Danish Krone" },
746 { "DOP", 2, ".", ",", TRUE
, "$", "Dominican Peso" },
747 { "DZD", 2, ",", " ", FALSE
, "DA", "Algerian Dinar" },
748 { "EEK", 2, ".", "", FALSE
, "EEK", "Kroon" },
749 { "EGP", 2, ".", ",", TRUE
, "ج.م.", "Egyptian Pound" },
750 { "ERN", 2, ".", ",", TRUE
, "Nfk", "Nakfa" },
751 { "ETB", 2, ".", ",", TRUE
, "Br", "Ethiopian Birr" },
752 { "EUR", 2, ",", " ", TRUE
, "€", "Euro" },
753 { "FJD", 2, ".", ",", TRUE
, "$", "Fiji Dollar" },
754 { "FKP", 2, ".", ",", TRUE
, "£", "Falkland Islands Pound" },
755 { "GBP", 2, ".", ",", TRUE
, "£", "Pound Sterling" },
756 { "GEL", 2, ",", " ", TRUE
, "₾", "Lari" },
757 { "GHS", 2, ".", ",", TRUE
, "GH₵", "Ghana Cedi" },
758 { "GIP", 2, ".", ",", TRUE
, "£", "Gibraltar Pound" },
759 { "GMD", 2, ".", ",", TRUE
, "D", "Dalasi" },
760 { "GNF", 0, ",", " ", TRUE
, "FG", "Guinea Franc" },
761 { "GTQ", 2, ".", ",", TRUE
, "Q", "Quetzal" },
762 { "GYD", 0, ".", ",", TRUE
, "$", "Guyana Dollar" },
763 { "HKD", 2, ".", ",", TRUE
, "$", "Hong Kong Dollar" },
764 { "HNL", 2, ".", ",", TRUE
, "L", "Lempira" },
765 { "HRK", 2, ",", ".", FALSE
, "kn", "Croatian Kuna" },
766 { "HTG", 2, ",", " ", FALSE
, "G", "Gourde" },
767 { "HUF", 2, ",", " ", FALSE
, "HUF", "Forint" },
768 { "IDR", 0, ",", ".", TRUE
, "Rp", "Rupiah" },
769 { "ILS", 2, ".", ",", TRUE
, "₪", "New Israeli Sheqel" },
770 { "INR", 2, ".", ",", TRUE
, "₹", "Indian Rupee" },
771 { "IQD", 2, ".", ",", TRUE
, "د.ع.", "Iraqi Dinar" },
772 { "IRR", 2, "/", ",", TRUE
, "ريال", "Iranian Rial" },
773 { "ISK", 0, ",", ".", FALSE
, "ISK", "Iceland Krona" },
774 { "JMD", 2, ".", ",", TRUE
, "$", "Jamaican Dollar" },
775 { "JOD", 3, ".", ",", TRUE
, "د.ا.", "Jordanian Dinar" },
776 { "JPY", 0, ".", ",", TRUE
, "¥", "Yen" },
777 { "KES", 2, ".", ",", TRUE
, "Ksh", "Kenyan Shilling" },
778 { "KGS", 2, ",", " ", FALSE
, "сом", "Som" },
779 { "KHR", 2, ".", ",", FALSE
, "៛", "Riel" },
780 { "KMF", 0, ",", " ", TRUE
, "CF", "Comoro Franc" },
781 { "KPW", 2, ".", "", FALSE
, "KPW", "North Korean Won" },
782 { "KRW", 0, ".", ",", TRUE
, "₩", "Won" },
783 { "KWD", 3, ".", ",", TRUE
, "د.ك.", "Kuwaiti Dinar" },
784 { "KYD", 2, ".", ",", TRUE
, "$", "Cayman Islands Dollar" },
785 { "KZT", 2, ",", " ", FALSE
, "₸", "Tenge" },
786 { "LAK", 0, ",", ".", TRUE
, "₭", "Kip" },
787 { "LBP", 2, ".", ",", TRUE
, "ل.ل.", "Lebanese Pound" },
788 { "LKR", 2, ".", ",", TRUE
, "Rs.", "Sri Lanka Rupee" },
789 { "LRD", 2, ".", ",", TRUE
, "$", "Liberian Dollar" },
790 { "LSL", 2, ".", "", FALSE
, "LSL", "Loti" },
791 { "LTL", 2, ".", "", FALSE
, "LTL", "Lithuanian Litas" },
792 { "LVL", 2, ".", "", FALSE
, "LVL", "Latvian Lats" },
793 { "LYD", 3, ".", ",", TRUE
, "د.ل.", "Libyan Dinar" },
794 { "MAD", 2, ",", " ", FALSE
, "DH", "Moroccan Dirham" },
795 { "MDL", 2, ",", " ", FALSE
, "L", "Moldovan Leu" },
796 { "MGA", 0, ",", " ", TRUE
, "Ar", "Malagasy Ariary" },
797 { "MKD", 2, ",", " ", TRUE
, "den", "Denar" },
798 { "MMK", 0, ".", ",", TRUE
, "K", "Kyat" },
799 { "MNT", 0, ".", ",", TRUE
, "₮", "Tugrik" },
800 { "MOP", 2, ",", " ", TRUE
, "MOP", "Pataca" },
801 { "MRO", 0, ",", " ", TRUE
, "UM", "Ouguiya" },
802 { "MTL", 2, ".", "", FALSE
, "MTL", "Maltese Lira" },
803 { "MUR", 0, ",", " ", TRUE
, "Rs", "Mauritius Rupee" },
804 { "MVR", 2, ".", ",", FALSE
, "ރ.", "Rufiyaa" },
805 { "MWK", 2, ".", ",", TRUE
, "MK", "Kwacha" },
806 { "MXN", 2, ".", ",", TRUE
, "$", "Mexican Peso" },
807 { "MXV", 2, ".", "", FALSE
, "MXV", "Mexican Unidad de Inversion (UDI)" },
808 { "MYR", 2, ".", ",", TRUE
, "RM", "Malaysian Ringgit" },
809 { "MZN", 2, ",", " ", FALSE
, "MTn", "Metical" },
810 { "NAD", 2, ",", " ", TRUE
, "$", "Namibia Dollar" },
811 { "NGN", 2, ".", ",", TRUE
, "₦", "Naira" },
812 { "NIO", 2, ".", ",", TRUE
, "C$", "Cordoba Oro" },
813 { "NOK", 2, ",", " ", TRUE
, "kr", "Norwegian Krone" },
814 { "NPR", 2, ".", ",", TRUE
, "रु", "Nepalese Rupee" },
815 { "NZD", 2, ".", ",", TRUE
, "$", "New Zealand Dollar" },
816 { "OMR", 3, ".", ",", TRUE
, "ر.ع.", "Rial Omani" },
817 { "PAB", 2, ".", ",", TRUE
, "B/.", "Balboa" },
818 { "PEN", 2, ".", ",", TRUE
, "S/.", "Nuevo Sol" },
819 { "PGK", 2, ".", ",", TRUE
, "K", "Kina" },
820 { "PHP", 2, ",", ",", TRUE
, "₱", "Philippine Peso" },
821 { "PKR", 0, ".", ",", TRUE
, "Rs", "Pakistan Rupee" },
822 { "PLN", 2, ",", " ", FALSE
, "zł", "Zloty" },
823 { "PYG", 0, ",", ".", TRUE
, "₲", "Guarani" },
824 { "QAR", 2, ".", ",", TRUE
, "ر.ق.", "Qatari Rial" },
825 { "RON", 2, ",", ".", FALSE
, "RON", "New Leu" },
826 { "RSD", 0, ",", ".", FALSE
, "RSD", "Serbian Dinar" },
827 { "RUB", 2, ",", " ", TRUE
, "₽", "Russian Ruble" },
828 { "RWF", 0, ",", " ", TRUE
, "RF", "Rwanda Franc" },
829 { "SAR", 2, ".", ",", TRUE
, "ر.س.", "Saudi Riyal" },
830 { "SBD", 2, ".", ",", TRUE
, "$", "Solomon Islands Dollar" },
831 { "SCR", 2, ",", " ", TRUE
, "SR", "Seychelles Rupee" },
832 { "SDG", 2, ".", ",", TRUE
, "SDG", "Sudanese Pound" },
833 { "SEK", 2, ",", ".", FALSE
, "kr", "Swedish Krona" },
834 { "SGD", 2, ".", ",", TRUE
, "$", "Singapore Dollar" },
835 { "SHP", 2, ".", ",", TRUE
, "£", "Saint Helena Pound" },
836 { "SLL", 0, ".", ",", TRUE
, "Le", "Leone" },
837 { "SOS", 0, ".", ",", TRUE
, "S", "Somali Shilling" },
838 { "SRD", 2, ",", ".", TRUE
, "$", "Surinam Dollar" },
839 { "STD", 0, ",", " ", FALSE
, "Db", "Dobra" },
840 { "SVC", 2, ".", "", FALSE
, "SVC", "El Salvador Colon" },
841 { "SYP", 0, ",", " ", TRUE
, "LS", "Syrian Pound" },
842 { "SZL", 2, ",", " ", TRUE
, "E", "Lilangeni" },
843 { "THB", 2, ".", ",", TRUE
, "฿", "Baht" },
844 { "TJS", 2, ",", " ", FALSE
, "смн", "Somoni" },
845 { "TMM", 2, ".", "", FALSE
, "TMM", "Manat" },
846 { "TND", 3, ",", " ", TRUE
, "DT", "Tunisian Dinar" },
847 { "TOP", 2, ".", ",", TRUE
, "T$", "Pa'anga" },
848 { "TRY", 2, ",", ".", FALSE
, "₺", "New Turkish Lira" },
849 { "TTD", 2, ".", ",", TRUE
, "$", "Trinidad and Tobago Dollar" },
850 { "TWD", 2, ".", ",", TRUE
, "NT$", "New Taiwan Dollar" },
851 { "TZS", 0, ".", ",", TRUE
, "TSh", "Tanzanian Shilling" },
852 { "UAH", 2, ",", " ", FALSE
, "₴", "Hryvnia" },
853 { "UGX", 0, ".", ",", TRUE
, "USh", "Uganda Shilling" },
854 { "USD", 2, ",", " ", TRUE
, "$", "US Dollar" },
855 { "USN", 2, ".", "", FALSE
, "USN", "US Dollar (Next day)" },
856 { "USS", 2, ".", "", FALSE
, "USS", "US Dollar (Same day)" },
857 { "UYI", 2, ".", "", FALSE
, "UYI", "Uruguay Peso en Unidades Indexadas" },
858 { "UYU", 2, ",", ".", TRUE
, "$", "Peso Uruguayo" },
859 { "UZS", 0, ",", " ", TRUE
, "soʻm", "Uzbekistan Sum" },
860 { "VEF", 2, ",", ".", TRUE
, "Bs.", "Bolivar Fuerte" },
861 { "VND", 2, ",", ".", FALSE
, "₫", "Dong" },
862 { "VUV", 0, ",", " ", TRUE
, "VT", "Vatu" },
863 { "WST", 2, ".", ",", TRUE
, "WS$", "Tala" },
864 { "XAF", 0, ",", " ", TRUE
, "FCFA", "CFA Franc BEAC" },
865 { "XAG", 2, ".", "", FALSE
, "XAG", "Silver" },
866 { "XAU", 2, ".", "", FALSE
, "XAU", "Gold" },
867 { "XBA", 2, ".", "", FALSE
, "XBA", "European Composite Unit (EURCO)" },
868 { "XBB", 2, ".", "", FALSE
, "XBB", "European Monetary Unit (E.M.U.-6)" },
869 { "XBC", 2, ".", "", FALSE
, "XBC", "European Unit of Account 9 (E.U.A.-9)" },
870 { "XBD", 2, ".", "", FALSE
, "XBD", "European Unit of Account 17 (E.U.A.-17)" },
871 { "XCD", 2, ",", " ", TRUE
, "$", "East Caribbean Dollar" },
872 { "XDR", 2, ",", " ", TRUE
, "XDR", "Special Drawing Rights" },
873 { "XFO", 2, ".", "", FALSE
, "XFO", "Gold-Franc" },
874 { "XFU", 2, ".", "", FALSE
, "XFU", "UIC-Franc" },
875 { "XOF", 0, ",", " ", TRUE
, "CFA", "CFA Franc BCEAO" },
876 { "XPD", 2, ".", "", FALSE
, "XPD", "Palladium" },
877 { "XPF", 0, ",", " ", FALSE
, "FCFP", "CFP Franc" },
878 { "XPT", 2, ".", "", FALSE
, "XPT", "Platinum" },
879 { "XTS", 2, ".", "", FALSE
, "XTS", "Code for testing purposes" },
880 { "XXX", 2, ".", "", FALSE
, "XXX", "No currency" },
881 { "YER", 2, ".", ",", TRUE
, "ر.ي.", "Yemeni Rial" },
882 { "ZAR", 2, ",", " ", TRUE
, "R", "Rand" },
883 { "ZMK", 2, ".", "", FALSE
, "ZMK", "Zambian Kwacha" },
884 { "ZWD", 2, ".", "", FALSE
, "ZWD", "Zimbabwe Dollar" }
886 guint n_iso4217cur
= G_N_ELEMENTS (iso4217cur
);
This page took 0.08337 seconds and 4 git commands to generate.