sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
113 stars 43 forks source link

Global str function only supports float arguments #581

Closed alimnios72 closed 3 years ago

alimnios72 commented 3 years ago

Even when the Roku docs say that str takes a float argument, in reality it can take double values as well:

Brightscript Debugger> myvar = 1605743966.521#
Brightscript Debugger> print type(myvar)
Double
Brightscript Debugger> print str(myvar)
 1.605744e+09

The current implementation tries to enforce that float numbers are taken as arguments and it fails if a double is provided

 function Str(value as Float) as String:
        * Argument 'value' must be of type Float, but received Double.

We should match Roku implementation