Page 1 of 1

[Implemented] The problem with floats persist

Posted: Thu Apr 04, 2002 10:54 am
by BackupUser
Restored from previous forum. Originally posted by Manolo.

Fred,
See the next example

Code: Select all

OpenConsole()
a.f=15.25
b.f=15.87
c.f=a.f+b.f
PrintN(StrF(c.f,2))
Input()
I think that the solution will be in StrF, because in the actual feature don´t
rounded, it's cutted.
Rounded the decimals is the solution.

Manolo

Posted: Thu Apr 04, 2002 11:21 am
by BackupUser
Restored from previous forum. Originally posted by PB.

I don't have an answer to your problem, but I've noticed that v3.0 now halts
the debug output upon program termination, so you no longer need to use the
console to test something -- woohoo!

Example: Your code above could now be written as follows:

Code: Select all

a.f=15.25 : b.f=15.87 : c.f=a.f+b.f
Debug(StrF(c.f,2))

PB - Registered PureBasic Coder

Edited by - PB on 04 April 2002 12:22:53

Posted: Thu Apr 04, 2002 5:14 pm
by BackupUser
Restored from previous forum. Originally posted by Manolo.

Please Fred,

I have two months waiting for 3.0 version with stoped developed.
The printer. Ok.
But... the floats not

I only make code for commercial aplications and work with EURO DECIMALS.
You have one solution for me ???
Thanks,

Manolo