[haiku-bugs] Re: [Haiku] #13618: Haiku lacks support for a locale-sensitive decimal point.

  • From: "korli" <trac@xxxxxxxxxxxx>
  • Date: Mon, 24 Jul 2017 10:23:09 -0000

#13618: Haiku lacks support for a locale-sensitive decimal point.
-------------------------+-------------------------------------------------
   Reporter:  owenca     |      Owner:  pulkomandy
       Type:  bug        |     Status:  closed
   Priority:  normal     |  Milestone:  R1/beta1
  Component:             |    Version:  R1/Development
  Kits/Locale Kit        |   Keywords:  BFormattingConventions,
 Resolution:  no change  |  BFloatFormat,
  required               |  BGenericNumberFormat::FractionSeparator()
 Blocked By:             |   Blocking:
Has a Patch:  0          |   Platform:  All
-------------------------+-------------------------------------------------

Comment (by korli):

 As a side note, an example using POSIX localeconv() (the comment from
 Adrien regarding LC_* variables apply). Weirdly, this works on Haiku, but
 not on Ubuntu for de_DE and it_IT.

 {{{
 #include <locale.h>
 #include <stdio.h>

 int main ()
 {
    struct lconv * lc;

    setlocale(LC_ALL, "de_DE.UTF-8");
    lc = localeconv();
    printf("Local Currency Symbol: %s\n",lc->currency_symbol);
    printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
    printf("Decimal Point = %s\n", lc->decimal_point);

         setlocale(LC_ALL, "it_IT.UTF-8");
    lc = localeconv();
    printf("Local Currency Symbol: %s\n",lc->currency_symbol);
    printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
    printf("Decimal Point = %s\n", lc->decimal_point);


    setlocale(LC_ALL, "fr_FR.UTF-8");
    lc = localeconv();
    printf("Local Currency Symbol: %s\n",lc->currency_symbol);
    printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
    printf("Decimal Point = %s\n", lc->decimal_point);

    setlocale(LC_ALL, "en_US.UTF-8");
    lc = localeconv();
    printf("Local Currency Symbol: %s\n",lc->currency_symbol);
    printf("International Currency Symbol: %s\n",lc->int_curr_symbol);
    printf("Decimal Point = %s\n", lc->decimal_point);

    setlocale(LC_ALL, "en_GB.UTF-8");
    lc = localeconv();
    printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
    printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);

    printf("Decimal Point = %s\n", lc->decimal_point);

    return 0;
 }
 }}}

--
Ticket URL: <https://dev.haiku-os.org/ticket/13618#comment:4>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: