Christian75
Member
Hi,
It says that NumberFormat and NumberFormat2 is supported in BANano but I get a different behavior than in B4J.
In B4J I get what I want:
314.16
In BANano I only get (wrong)
314
If I change MinimumFractions to 2 then I get (this is ok but not right in the next example):
314,16
When I set the number to 0 (still a Double) I get what I do not want:
0,00
In B4J then I get what I want:
0
If I use original max 2 and min 0 which is the way I want to use the NumberFormat2.
I would say that this is a bug in BANano where the Maximum- and MinimumFractions does not work as intended but maybe there is a way to solve this ?
It says that NumberFormat and NumberFormat2 is supported in BANano but I get a different behavior than in B4J.
If I use:NumberFormat2 (Number As Double, MinimumIntegers As Int, MaximumFractions As Int, MinimumFractions As Int, GroupingUsed As Boolean) As String
Converts the specified number to a string.
The string will include -
GroupingUsed - Determines whether to group every three integers.
- at least Minimum Integers,
at most Maximum Fractions digits and
at least Minimum Fractions digits.
B4X:
NumberFormat2(314.159265359, 1, 2, 0, False))
In B4J I get what I want:
314.16
In BANano I only get (wrong)
314
If I change MinimumFractions to 2 then I get (this is ok but not right in the next example):
314,16
When I set the number to 0 (still a Double) I get what I do not want:
0,00
In B4J then I get what I want:
0
If I use original max 2 and min 0 which is the way I want to use the NumberFormat2.
I would say that this is a bug in BANano where the Maximum- and MinimumFractions does not work as intended but maybe there is a way to solve this ?