3
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by ebi1
0

In Delphi, I like the FormatFloat function. If you look at the docs for it, you can also check out the "See Also" stuff.

0

I have try the FormatFloat function but I keep a error message:
'no overloaded version of 'FormatFloat' that can be called with these arguments '.
I don't know how to fix it please can you give me some example or tell me how it work.

0

Place your cursor on the name "FormatFloat" and press F1. You'll get a help page telling you everything you need to know about the function. Mine says:

Formats a floating point value

Unit
SysUtils

Category
floating point conversion routines [B]function[/B] FormatFloat([B]const[/B] Format: [B]string[/B]; Value: Extended): [B]string[/B]; Description
...

So you'll want to make sure the first argument is a string and the second argument is a floating point type (single, double, extended, real, or real48).

Good luck.

0

Hi afro007.,

Duoas is right about using the FloatFormat, but here is an example:

Var TempSum : Real;

TempSum:=105.6;
Label1.Caption:=FormatFloat('###,###.##', TempSum);

however there are other ways to convert Real to String : FloatToStr.
Label1.Caption:=FloatToStr(TempSum);
(which can show you 105.6343254)
and FloatToStrF, and FloatToText.

sorry for my english, i hope i helped.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.