NumberFormat (Number As Double, MinimumIntegers As Int, MaximumFractions As Int) As String
Converts the specified number to a string.
The string will include at least Minimum Integers and at most Maximum Fractions digits.
Example:
Log(NumberFormat(12345.6789, 0, 2)) '"12,345.68"
Log(NumberFormat(1, 3 ,0)) '"001"
B4R Question B4R NumberFormat string buffer overwrite or out-of-bounds? - emexes    
Aug 13, 2019 I used NumberFormat. I have tried this code on two different ESP32 modules:
Private Sub AppStart... 10000
Serial1.Stream.WriteBytes(B1, 0, B1.Length)
Log( NumberFormat...
link: https://www.b4x.com/android/forum/threads/memory-variables-and-objects.65672/#content...
link: It uses the stack buffer for this.
You had me at "stack buffer". Off to read up about tha...
link: Moved to the questions forum.
NumberFormat creates a string. The string must be stored somewhere...
B4J Question NumberFormat issue or BUG? - Cableguy    
Mar 16, 2016I have the following code:
mValue = NumberFormat2(TextField1.Text + StepValue, 1, mDecimals, mDecimals, False)
where mValue is Double, StepValue and mDecimals are integers defined in the designer...
Given a mDecimals of value 2, shouldn't this code convert a number like 1.1 to a string like "1.10"??
I ask because all I get is the same decimal places as the mathematical value (i.e 1 + 0.1 = 1.1) , no mater how I format the number
Seems like using NumberFormat on a variable...
B4A Question problem with NumberFormat with Android 11 - Lello1964    
Jun 16, 2021(NumberFormat(a,0,4) )
Android 9 :
result = 0
Android 11 :
result = .0
why there is . before 0 ?
Someone have some problem, how solve ?
other example
Dim a As Int =12
Log(NumberFormat(a,0,4...
link: , MaximumFractions As Int) As String
Return NumberFormat(Number,Max(MinimumIntegers,1),MaximumFractions)
End...
link: , MaximumFractions As Int) As String
NumberFormat(Number,Max(MinimumIntegers,1),MaximumFractions)
End Sub...
link: Would solve the problem by simply setting the number of digits of integers to 1 rather than 0.
Set...
Italian Bug su Andorid 11- numberFormat - Lello1964    
Jun 16, 2021Ho riscontrato un problema serio su Android 11.
Esempio su Android 9
Dim a As Int =0
Log(NumberFormat(a,0,4) )
risultato : 0
su Android 11
risultato .0
un disastro
avete una soluzione...
link: Ti ringrazio infinitamente per l'aiuto.
Senza la tua soluzione sarei in un mare di guai.
Sareb...
link: la punteggiatura italiana....
link: ?...
B4A Question Rounding Numbers: Round2 or Numberformat2 - Roger Daley    
Nov 11, 2014   
(1 reaction)This is an answer to a question raised in my mind by a comment from Erel, that I should not use Round2 but use Numberformat2 for rounding numbers.
Most of us are taught that for digits below 5, round down, for 5 and greater round up.
IE 4.725 to 2 decimal places gives 4.73. This is the result given by Round2.
Numberformat2 gives the result 4.72 after a bit of research I found... places is 4.72. 4.735 to 2 decimal places is 4.74.
Numberformat2 gives these results.
This link...
Bug? Numberformat2 decimal places - Andrew (Digitwell)    
Nov 3, 2020 As Double = 1000
private s as string = NumberFormat2(n,0,2,0,False)
log(s)
...
link:
This is not a bug as 1000.0 meets the set minimum and maximum values.
giving you the average of 0...
link: Anyway, as written in post #2, on my device it displays OK.
I tested with n = 1000.001 and the displ...
link:
I would expect, that for 1000 with MiniumFraction = 0, the result beeing 1000 and not 1000.0.
And w...
Bug? NUMBERFORMAT error - moore_it    
Sep 3, 2020The NumberFormat statement in versione 8.50 wrong.
for example : FormatNumber(150,5,0) = 00,150...
link: Ok i test it and it works fine !
Sorry...
link: It is correct.
NumberFormat converts a Double into a String with "," as the thousand...
link: Yes, it is wrong (in b4j 8.10 too)....
B4A Tutorial Download huge files with HttpUtils2 - Erel    
Jul 25, 2021   
(17 reactions)   
tags: download, erel, download with progress = NumberFormat(Progress / 1024, 0, 0) & "KB / " & _
NumberFormat(Total / 1024, 0, 0...
B4R Question NumberFormat problem - kolbe    
May 21, 2017I'm working with a Feather M0 and when I call NumberFormat twice the program halts. Using... that the code crashes.
Any ideas?
oled.GFX.DrawText(NumberFormat(temp(counter),1,1)).DrawText(" F"...
link: Works fine on ESP8266.
Try this:
Download the attached Define-Template.h and put it in the projects...
link: Can you upload a program that crashes (and doesn't need any additional hardware)? I will test it...
Bug? NumberFormat(Number,0,2): Works on Android but doesn't work in B4J - LWGShane    
Feb 22, 2020   
(1 reaction)If you use NumberFormat(1000000,0,2) on Android it correctly displays as "1,000,000" but displays as "1000000" on B4J.
B4J:
89007
B4A:
89006...
link: Using only NumberFormat2 avoids the problem.
Also B4XFormatter doesn't have this problem...
link: It is indeed a bug.
It was fixed in B4A and wasn't fixed in B4J. It is now fixed for the next up...
link: /numberformat2-changes-numberformat-behaivior.86047/...
Page: 1  
2  
3  
4  
5