Oxygen Basic

Programming => Bugs & Feature Requests => Topic started by: Emil_halim on April 06, 2013, 09:48:26 AM

Title: print -5
Post by: Emil_halim on April 06, 2013, 09:48:26 AM

try the title and see the bug
Title: Re: print -5
Post by: Emil_halim 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.....
Title: Re: print -5
Post by: Charles Pegge 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!
Title: Re: print -5
Post by: Charles Pegge on April 06, 2013, 01:15:03 PM
Fixed RTL32 negative sign bug.

X
Title: Re: print -5
Post by: Emil_halim 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
Title: Re: print -5
Post by: Emil_halim 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)

Title: Re: print -5
Post by: Charles Pegge 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
Title: Re: print -5
Post by: Emil_halim on April 08, 2013, 07:33:14 AM

thanks Charles.