Page 1 of 1
Posted: Sat Apr 12, 2003 10:30 am
by BackupUser
Restored from previous forum. Originally posted by Num3.
I need to format a string that comes like this:
12.25486
into
12.25
in vb there is format(string,"##.##") but there's nothing like this in PB...
HELP !!!
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
Posted: Sat Apr 12, 2003 10:36 am
by BackupUser
Restored from previous forum. Originally posted by freak.
look here:
http://www.reelmediaproductions.com/pb/ ... unklib.zip
-------------------------------
http://freak.coolfreepages.com/
Posted: Sat Apr 12, 2003 12:54 pm
by BackupUser
Restored from previous forum. Originally posted by Num3.
Your tip has been of great help...
But unfortunatly it does not function properly with float numbers
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
Posted: Sat Apr 12, 2003 1:21 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.
try:
--Kale
In love with PureBasic! 
Posted: Sat Apr 12, 2003 2:03 pm
by BackupUser
Restored from previous forum. Originally posted by Num3.
It works (kind of) !!!
I was wrongly passing the value into the function....
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...
Posted: Sat Apr 12, 2003 3:59 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.
or to deal with other numbers and crop them to 2 decimal places:
Code: Select all
num.f = 12.25486
Debug StrF((Round((num * 100), 1)) / 100)
--Kale
In love with PureBasic! 
Posted: Sat Apr 12, 2003 4:45 pm
by BackupUser
Restored from previous forum. Originally posted by Num3.
Try this...
you'll see what i mean:
7000 € isn't much... i guess my app will go far way pass 7000 in a few months...
num.f = 7311.25486
Debug StrF((Round((num * 100), 1)) / 100)
--
Kind Regards
Rui Carvalho
Old programmers never die... They branch into a subroutine...