Delphi Chart With 2 Decimal Places
Hi, just learning Excel here (and statistics as well) and have an issue with a simple pie chart. The data entered is in the form x.x, so 42.4, 5.5, 18.3, etc. When displaying the pie chart, Excel rounds all of these to the nearest integer. If there are multiple entries that are rounded up, the last entry has to be rounded down significantly to conform to 100%, or vice versa. In the example, the last entry was 42.4, and it gets rounded down to 41% on the pie chart.
I can not see any way to allow Excel to show anything other than integer values on the pie chart. Surely there must be a way to show decimal points of one's choosing?

Delphi Format to 2 decimal places. Some of the results of this function show '9.666' and I would like that to show as '9.67'. From novice to tech pro — start learning today. Business Communication By: Martin VanDerSchouw.
I have to selected some column data from a database table and make this data with two decimal places only. I see this
What is that #9?
How can I deal with the data I selected to make it only keep two decimal places?
I am very new to Delphi.
Thanks!
5 Answers
#9
is the character with code 9, TAB.
If you want to convert a floating point value to a string with 2 decimal places you use one of the formatting functions, e.g. Format()
:
#9
is the tab character.
If f
is a floating-point variable, you can do FormatFloat('#.##', f)
to obtain a string representation of f
with no more than 2 decimals.
The internal float format routines only work with simple numbers > 1
You need to do something more complicated for a general purpose decimal place limiter that works correctly on both fixed point and values < 1 with scientific notation.
I use this routine
So, with digits=2, 1.2349 rounds to 1.23 and 1.2349E-17 rounds to 1.23E-17
Andy k