Scenario:
To trim leading zeros from positive and negative floating point numbers
Input:
000.123
00.123
01.123
-001.123
-00.123
-040.123
Desired output:
0.123
0.123
1.123
-1.123
-0.123
-40.123
Question:
Is there an inbuilt function which will make this specific formatting easier and more efficient than running each number through combinations of substr()
, strpos()
, explode()
and if
statements?