B4J Question Comma in Thousands e.g. £1,000.00?

ElliotHC

Active Member
Licensed User
From the help, NumberFormat2 returns a String.
- 0 -> MinimumIntegers
- 3 -> MaximumFractions
- 2 -> MinimumFractions
- True -> GroupingUsed
Examples:
MyNumber Result
12.123456 12.123
12345.1 12,345.10
0.12 .12
 

Sandman

Well-Known Member
Licensed User
Somewhat relevant article:

Falsehoods programmers believe about prices
https://gist.github.com/rgs/6509585

(Not all regions separate thousands with a comma. So if your app targets more than the users that do that, you might want to use a smarter solution.)
 

OliverA

Expert
Licensed User
(Not all regions separate thousands with a comma. So if your app targets more than the users that do that, you might want to use a smarter solution.)
The solution pointed to by @José J. Aguilar takes these issues into account. Now if you also want to display the appropriate currency symbol, then the article linked to in the provided solution gives the appropriate information.
 
Top