decimal problem
From: Bert Prins (prinsoft_at_hotmail.com)
Date: 01/07/04
- Next message: Tom de Neef: "Re: decimal problem"
- Previous message: Tim: "Re: PathCleanupSpec Windows API function"
- Next in thread: Tom de Neef: "Re: decimal problem"
- Reply: Tom de Neef: "Re: decimal problem"
- Reply: J French: "Re: decimal problem"
- Reply: Rob Kennedy: "Re: decimal problem"
- Reply: Maarten Wiltink: "Re: decimal problem"
- Reply: Dot: "Re: decimal problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 7 Jan 2004 12:23:40 +0100
Hello.
First: the best wishes for 2004 to all of you.
I have a problem with decimals.
I have two variables of the type Double. During the program the first
variable (fBtw) has the value 1724.725 and the second variable (fBruto)
10802.225. Then I converts both variables to strings with Format('%.2f',
variable):
sfBtw := Format('%.2f', [fBtw]); // -> 1724.72
sfBruto := Format('%.2f', [fBruto]); // -> 10802.23
Why, o why converts Format .725 to .72 and .225 to .23 ????? I tried it
under WinNT and Win2000 with the same result.
Is there a better way to convert a double with more than 2 decimals to a
double with 2 decimals?
Bert Prins
- Next message: Tom de Neef: "Re: decimal problem"
- Previous message: Tim: "Re: PathCleanupSpec Windows API function"
- Next in thread: Tom de Neef: "Re: decimal problem"
- Reply: Tom de Neef: "Re: decimal problem"
- Reply: J French: "Re: decimal problem"
- Reply: Rob Kennedy: "Re: decimal problem"
- Reply: Maarten Wiltink: "Re: decimal problem"
- Reply: Dot: "Re: decimal problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|