I need a loop to increase the number by 3rd decimal and the print should look like this
1.1
1.101
1.102
1.103
...
2.0
2.001
2.002
...
2.1
2.101
...
for ($i = 1.1; $i <= 3; $i += .001){
echo $i . '<br />';
}
the start seems to be ok but somewhere along the loop the decimal number becomes to big
1.54
1.541
1.542
1.543
1.544
1.545
1.546
1.547
1.548
1.549
1.55
1.551
1.552
1.553
1.554
1.5549999999999
1.5559999999999
1.5569999999999
1.5579999999999
1.5589999999999
And if I use
number_format($i,3)
all my numbers have 3 decimal points like
1.100 and I need it to be 1.1 .
What am I missing ?