ElliotHC Active Member Licensed User Jul 25, 2019 #1 I need to add a comma in a label value when above 999, is this easy to do?
R rboeck Well-Known Member Licensed User Longtime User Jul 25, 2019 #2 Just search for NumberFormat and NumberFormat2. Upvote 0
josejad Expert Licensed User Longtime User Jul 25, 2019 #3 Test this: https://www.b4x.com/android/forum/threads/solved-setting-a-decimal-separator.105981/#post-663491 Upvote 0
Test this: https://www.b4x.com/android/forum/threads/solved-setting-a-decimal-separator.105981/#post-663491
ElliotHC Active Member Licensed User Jul 25, 2019 #4 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 Upvote 0
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
DonManfred Expert Licensed User Longtime User Jul 25, 2019 #5 you can also check [B4X] B4XFormatter - Advanced number formatter Upvote 0
Sandman Expert Licensed User Longtime User Jul 25, 2019 #6 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.) Upvote 0
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.)
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2019 #7 Please post a few numbers as an example of the format you are looking for. Upvote 0
ElliotHC Active Member Licensed User Jul 25, 2019 #8 Erel said: Please post a few numbers as an example of the format you are looking for. Click to expand... I had 'False' when I needed 'True' in NumberFormat2. Upvote 0
Erel said: Please post a few numbers as an example of the format you are looking for. Click to expand... I had 'False' when I needed 'True' in NumberFormat2.
OliverA Expert Licensed User Longtime User Jul 25, 2019 #9 Sandman said: (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.) Click to expand... 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. Upvote 0
Sandman said: (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.) Click to expand... 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.