Italian NUMBERFORMAT2 - LucaMs (first post)    Sep 16, 2021   (2 reactions) 119199
Il secondo parametro è il numero minimo di interi che dovranno essere visualizzati.
NumberFormat2(variabile, 1, 2, 0, False) B4J Question [BANano]NumberFormat2 gives a different behavior in BANano than in B4J - alwaysbusy (first post)    Sep 20, 2021   (1 reaction) This does indeed sound like a bug as it is the intention that both act the same. I will have a look. Bug? NUMBERFORMAT error - klaus (first post)    Sep 03, 2020   (4 reactions) It is correct.
NumberFormat converts a Double into a String with "," as the thousand separator by default.
To get the result you expect you should use:
NumberFormat2(150, 5, 0, 0, False) B4A Question Doubt on Number Format? - aeric (first post)    Jul 02, 2021   (1 reaction) It seems it also happen when using NumberFormat2.
Log(NumberFormat2(-101010101010101500.5553, 1, 2, 2, True)) ' <-- -101,010,101,010,101,504.00
Log(NumberFormat2(101010101010101500.5553, 1, 2, 2, True)) ' <-- 101,010,101,010,101,504.00 Italian decimal numbers - giannimaione (first post)    Jun 01, 2023 Numberformat2 Bug? NumberFormat & NumberFormat2 not formating decimals - klaus (first post)    Nov 03, 2015   (2 reactions) What exactly do you expect ?
NumberFormat(Number As Double, MinimumIntegers As Int, MaximumFractions As Int)
returns 2 fractions max but removes any non significant zeros.
If you want at least one fraction you should use NumberFormat2:
NumberFormat2(Number As Double, MinimumIntegers As Int, MaximumF B4A Library [B4X] B4XFormatter - Advanced number formatter - Erel    May 21, 2023   (38 reactions) B4XFormatter is an alternative to NumberFormat / NumberFormat2 keywords. It is implemented in B4X and it is cross platform. There are two types in the library: B4XFormatter - The main class. B4XFormatData - A type with various configurable fields. The formatter holds a list of format data objects B4J Question Very strange problem adding two numbers - MegatenFreak (first post)    Apr 07, 2021   (1 reaction) I use NumberFormat (and NumberFormat2) a lot. It's a life saver!
I was just wondering if there's a particular reason, something evil or mysterious about number 3, or if I was doing something wrong.
Fortunately, thanks to Erel, NumberFormat also "rounds" the number to the specified number of fraction Bug? NumberFormat2() changes NumberFormat() behaivior - Erel (first post)    Nov 13, 2017   (2 reactions) It is fixed for the next update. B4A Question Remove leading Zero's - stevel05 (first post)    Jan 31, 2016   (2 reactions) Numberformat2 allows you to turn off the number grouping so you could still use 4 digits if you need to. Page: 1   2   3   4   5   6   7   Powered by ColBERT |