I would like to display blank value when the value is equal to zero, but when it is a non-decimal number to be displayed with preceeding zeros, example: when it's equal to two, i want it to be presented as 2.00. I tried with '0.00' but it shows literaly 0.00 when it's equal to zero, and if i use "#.##" then it presents the zero value as I want it, but it shows 2 whitout preceeding zeros.
I want ' ' when it's zero and '2.00' when its two.

Recommended Answers

All 2 Replies

Look here for number formatting: http://www.delphibasics.co.uk/RTL.asp?Name=WriteLn

After each expression, you can add formatting options:

:width Field width for strings + numbers
:precision Decimal digits for numbers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.