Board index » delphi » Help with FloatToStr

Help with FloatToStr

Hi,

I would like to display a floating point number within a Text Label.
Obviously I must convert the number into a string in order to display it, I
can do this nicely just now.

I would like to display the number in a specific format however, and the
Delphi help is no good. I would like my number in the format XX.XX , i.e..
two places before and after the period (16.09 etc.).

Can anyone help??

Cheers,

Jamie.
--
      .     .
 _    |\.-./|
 \\   |'a a'|
  \\ =(= v =)=
   \\ /\ o /\  /* * * * * * * * * * * * * * * * * * * *
    \\| \_/ |   * Jamie from Bonny Scotland! Och Aye! *
     \ || |||   * Email: j.cous...@{*word*269}.net         *
     (_||_||_)  * * * * * * * * * * * * * * * * * * * */
       ^^ ^^

 

Re:Help with FloatToStr


try this function:
  formatFloat('0.00',16.09)

Jamie <j.cous...@{*word*269}.net> a crit dans l'article
<6tpb00$ne...@nclient5-gui.server.{*word*269}.net>...

Quote
> Hi,

> I would like to display a floating point number within a Text Label.
> Obviously I must convert the number into a string in order to display it,
I
> can do this nicely just now.

> I would like to display the number in a specific format however, and the
> Delphi help is no good. I would like my number in the format XX.XX ,
i.e..
> two places before and after the period (16.09 etc.).

> Can anyone help??

> Cheers,

> Jamie.
> --
>       .     .
>  _    |\.-./|
>  \\   |'a a'|
>   \\ =(= v =)=
>    \\ /\ o /\  /* * * * * * * * * * * * * * * * * * * *
>     \\| \_/ |   * Jamie from Bonny Scotland! Och Aye! *
>      \ || |||   * Email: j.cous...@{*word*269}.net         *
>      (_||_||_)  * * * * * * * * * * * * * * * * * * * */
>        ^^ ^^

Re:Help with FloatToStr


In article <6tpb00$ne...@nclient5-gui.server.{*word*269}.net>, "Jamie"

Quote
<j.cous...@{*word*269}.net> writes:
>I would like to display a floating point number within a Text Label.
>Obviously I must convert the number into a string in order to display it, I
>can do this nicely just now.

>I would like to display the number in a specific format however, and the
>Delphi help is no good. I would like my number in the format XX.XX , i.e..
>two places before and after the period (16.09 etc.).

Look up "Format Strings" in Delphi help - its a lot of good stuff, not only for
your present problem.

Alan Lloyd
alangll...@aol.com

Other Threads