FormatNumber always display 2 decimals even for integer

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

FormatNumber always display 2 decimals even for integer

Post by Marc56us »

As 'NbDecimals' is optional, it would be logical that in the absence of this parameter there are no decimals displayed (if integer) and not two as is currently the case.

Code: Select all

Debug FormatNumber(125400.25) ; Will display: 125,400.25
Debug FormatNumber(125400)    ; Will display: 125,400.00 ; .00 not needed
Debug FormatNumber(125400, 0) ; Will display: 125,400    ; is OK but need to add parameter
-- Fr
Comme "NbDecimals" est facultatif, il serait logique qu'en l'absence de ce paramètre, pour un entier, aucune décimale ne soit affichée et non deux comme c'est le cas actuellement.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: FormatNumber always display 2 decimals even for integer

Post by ChrisR »

hmm, not sure, FormatNumber seems to use the system default value
In windows, it's stored in the registry, here:
HKCU\Control Panel \International,iDigits (default value : 2)
iDigits = Number of digits after the dot in decimal values.
Post Reply