Formatted Output: Exact number of Decimal Places

Q. Schroll via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 16 13:24:51 PDT 2016


Lets say I want to print a table with floats. How can it be 
formatted like that:
|  2.4   |
| 12.2   |
|  8.131 |
| 17.44  |
Also acceptable is
|  2.400 |
| 12.200 |
|  8.131 |
| 17.440 |
but not
| 02.4   |
| 12.2   |
| 08.131 |
| 17.44  |
or any other solutions with leading zeros.


More information about the Digitalmars-d-learn mailing list