Menu

#117 Support Locale in number?string("0.#######")

2.3.24
closed-fixed
nobody
None
5
2016-05-21
2015-02-27
cgendreau
No

Hi,

It would be very handy to be able to do something like ?string("en_US","0.#######") on a number to specify the Locale to use to format the number.

My current issue is to limit the number of digits on a coordinates (lat/long) so, I want to print a dot(.) even if the Locale would use a comma (,).

Regards,

Christian

Discussion

  • Dániel Dékány

    Why does the decimal separator change to "." just because it's a coordinate? Because it's program-consumed value? Then the solution would be rather ?c(4) or like. OTOH the pattern that I want to push in future releases (far future...) is that you don't specify the mask etc., instead you indicate what the meaning of the number is, like ${x?my:coord}. And then at a central location (maybe even in Java) you specify how a coordinate should look. Anyway, that's the far future, but as far as RFE-s go, it's relevant. Or, you can do it right now with functions, like ${my.coord(x)}, it's just less appealing.

     

    Last edit: Dániel Dékány 2015-02-28
  • Dániel Dékány

    As of 2.3.24 you can specify pretty much all DecimalFormatSymbol-s in the pattern string, in the 3rd ;-separated section: "0.###;; dec='.'". It's not changing the locale, instead, you override the symbols.

     
  • Dániel Dékány

    • Group: undecided --> 2.3.24
     
  • Dániel Dékány

    • status: open --> closed-fixed
     

Log in to post a comment.