I have some problems with floattostrF. I see the following behaviour:
test:=floattostrF(0.99111,FFFixed,0,1);//=> 1.0
test:=floattostrF(0.99111,FFgeneral,0,4);//=> 0.99
test:=floattostrF(0.99111,FFgeneral,0,3);//=> 0.99
test:=floattostrF(0.99111,FFgeneral,0,2);//=>0.99
test:=floattostrF(0.99111,FFgeneral,0,1);//=> 0.99
test:=floattostrF(0.99111,FFgeneral,0,0); //=> 0.99
Maybe I'm wrong, but I would expect that
floattostrF(0.99111,FFgeneral,0,1)
would produce a string '1'. Why is it producing 0.99?
More tests. Rounding less then 2 decimals seems not possible. How to round to one decimal behind the decimal separator?
test:=floattostrF(0.9911,FFgeneral,0,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.9911,FFgeneral,0,3);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,0,2);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,0,1);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,0,0);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,1,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.9911,FFgeneral,1,3);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,1,2);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,1,1);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,1,0);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,2,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.9911,FFgeneral,2,3);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,2,2);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,2,1);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,2,0);//=> 0.99
test:=floattostrF(0.9911,FFgeneral,3,4);//=> 0.991 three decimals
test:=floattostrF(0.9911,FFgeneral,3,3);//=> 0.991
test:=floattostrF(0.9911,FFgeneral,3,2);//=> 0.991
test:=floattostrF(0.9911,FFgeneral,3,1);//=> 0.991
test:=floattostrF(0.9911,FFgeneral,3,0);//=> 0.991
test:=floattostrF(0.98511,FFgeneral,0,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.98511,FFgeneral,0,3);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,0,2);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,0,1);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,0,0);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,1,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.98511,FFgeneral,1,3);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,1,2);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,1,1);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,1,0);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,2,4);//=> 0.99 rounding to two decimals
test:=floattostrF(0.98511,FFgeneral,2,3);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,2,2);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,2,1);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,2,0);//=> 0.99
test:=floattostrF(0.98511,FFgeneral,3,4);//=> 0.985 three decimals
test:=floattostrF(0.98511,FFgeneral,3,3);//=> 0.985
test:=floattostrF(0.98511,FFgeneral,3,2);//=> 0.985
test:=floattostrF(0.98511,FFgeneral,3,1);//=> 0.985
test:=floattostrF(0.98511,FFgeneral,3,0);//=> 0.985
Han