Author Topic: print -5  (Read 3217 times)

0 Members and 1 Guest are viewing this topic.

Emil_halim

  • Guest
print -5
« on: April 06, 2013, 09:48:26 AM »

try the title and see the bug

Emil_halim

  • Guest
Re: print -5
« Reply #1 on: April 06, 2013, 11:12:27 AM »

Hi peter ,

I always get 5 without the mines sign.

i am using rtl so the exe did not require Oxygen.dll

any help Mr. Charles.....

Charles Pegge

  • Guest
Re: print -5
« Reply #2 on: April 06, 2013, 12:46:41 PM »
Yes the problem applies to the str function in RTL32. O2Runtime and RTL64 are okay. I'm onto the case!

Charles Pegge

  • Guest
Re: print -5
« Reply #3 on: April 06, 2013, 01:15:03 PM »
Fixed RTL32 negative sign bug.

X

Emil_halim

  • Guest
Re: print -5
« Reply #4 on: April 07, 2013, 07:36:50 AM »

thankes Charles.

how you print a float value?

Code: [Select]
print 100.00  this  print only 100

Emil_halim

  • Guest
Re: print -5
« Reply #5 on: April 07, 2013, 09:06:34 AM »
Hi Peter,

try this
Code: [Select]
indexbase 0
$ filename "FPUTest.exe"
#include "..\..\inc\RTL32.inc"

   float f = -5.01
    print str(f,1)

« Last Edit: April 07, 2013, 09:22:00 AM by Emil_halim »

Charles Pegge

  • Guest
Re: print -5
« Reply #6 on: April 07, 2013, 12:30:12 PM »
This controls number formatting at the lowest level:


'   numberformat
'remarks:  there are 6 parameters:
'          1 decimal places (0..16)
'          2 strip trailing zeros (0 or 1)
'          3 always use scientic notation E format (0 or 1)
'          4 suppress 0 before decimal point: 0.1 becomes .1 (0 or 1)
'          5 insert extra leading space for non-negative numbers (0 or 1)
'          6 width allocated before decimal point: (0..31)
'            (inserting lead padding spaces)
'
'          when no parameters are given, it reverts to the default settings:
'          16,1,0,0,0,0
'          rounding is automatically performed before the decimal places are truncated.

numberformat 16,0,0,0,0,0 'do not strip trailing zeros
print str(100,2) ' 100.00
numberformat 'default

Emil_halim

  • Guest
Re: print -5
« Reply #7 on: April 08, 2013, 07:33:14 AM »

thanks Charles.