Hi guys,
for reuse of some eVB3-Code I created a Function namend
This is to get a string with leading zeros from any value.
But what happens:
ZeroNum(2,2) > "02" = ok
ZeroNum(2,1) > "2" = ok
ZeroNum(2,0) > "2" ... hey, just as ZeroNum(12345,2) should lead to "12345", it's ok.
ZeroNum(2,4) > "0,002" - instead of expected "0002"
ZeroNum(2,6) > 000,002 - instead of "000002"
If I change the Code using Numberformat2,
everything comes up fine.
As the first 3 params in the tooltip help are identical (value, MinimumIntegers, MaximumFractions), I think this is a fat bug, isn't it?
B4A version is 3.20.
for reuse of some eVB3-Code I created a Function namend
B4X:
Sub ZeroNum(value As Object, digits As Int) As String
Dim e As String
e = NumberFormat(value,digits,0)
Return e
End Sub
But what happens:
ZeroNum(2,2) > "02" = ok
ZeroNum(2,1) > "2" = ok
ZeroNum(2,0) > "2" ... hey, just as ZeroNum(12345,2) should lead to "12345", it's ok.
ZeroNum(2,4) > "0,002" - instead of expected "0002"
ZeroNum(2,6) > 000,002 - instead of "000002"
If I change the Code using Numberformat2,
B4X:
e = NumberFormat2(value,digits,0,0,False)
As the first 3 params in the tooltip help are identical (value, MinimumIntegers, MaximumFractions), I think this is a fat bug, isn't it?
B4A version is 3.20.