Hi!
Just found that Val() doesn't give back correct result if the floaing point number starting with the decimal point.
Val(".1415") => 0
Val("0.1415") => 0.1415
Val("0"..".1415") => 0.1415
All calculators and programming languages that I know means the number is greater that 0 and smaller then 1 if it starts with a decimal point. I think Hollywood should behave just like others in this context. Don't you?
Bye!
val() with floating point < 1
Re: val() with floating point < 1
Here is a workaround:
Code: Select all
factory_val=Val
function Val(s)
if LeftStr(s,1)="."
s="0"..s
elseif LeftStr(s,2)="-."
s="-0"..s
endif
Return(factory_val(s))
endfunction
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: val() with floating point < 1
Thanks, it's fixed now.