Change 0.%d
to 0.%03d
. Also see here.
0.%d range between 0-100 is the same as 100-1000
-
30-05-2022 - |
Question
I have the command:
string.format("movel(p[0.%d,- 0.%d, 0.%d, -0.5121, -3.08, 0.0005])"+ "\n", averageX1, averageY1, averageY2 )
Where average value can change from 0 to 700. When the value is
averageX1 = 344
averageY1 = 222
averageY2 = 150
The command becomes:
movel(p[0.344,- 0.222, 0150, -0.5121, -3.08, 0.0005])
When one of the average becomes lower then 100:
averageX1 = 80
The command becomes
movel(p[0.**80**,- 0.222, 0150, -0.5121, -3.08, 0.0005])
I want it to become :
movel(p[0.**080**,- 0.222, 0150, -0.5121, -3.08, 0.0005]
How can I change this so it will have the value that can be from 0 tot 100.
ps. It is the "0" that must be in front of the "8".
kind regards pascal
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow