Did numberFormat Break?
bobsneidar at iotecdigital.com
Thu Feb 15 12:59:01 EST 2018
On second thot, I think I will just use my own number formatting function.
> On Feb 15, 2018, at 09:54 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> Thanks Klaus and Mike indeed you are correct. I keep making the mistake of reading the dictionary. ;-P I don't see anything there that refers to only working with containers, only that the results of the calculation is affected.
> But it's more complex than even that. Given:
> set the numberFormat to "0.00"
> put 0 into textprice
> put textprice
> displays 0, not 0.00. So a calculation *must* be performed on a variable *and* the variable put into a container in order for this to take effect. What I am going to do instead to initialize a numberic variable is to add 0 to a variable.
> The second part I am sketchy on tho. I think the script editor variable watcher is itself a livecode stack with livecode fields, so it ought to reflect the results of numberFormat, however numberFormat applies only to the local script it is set in, so how that could be accomplished I do not know.
> I think I will put in a feature request to update the dictionary to reflect this.
> Bob S
>> On Feb 15, 2018, at 09:34 , Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
>> Hi Bob,
>>> Am 15.02.2018 um 18:20 schrieb Bob Sneidar via use-livecode <use-livecode at lists.runrev.com>:
>>> I have this in a script:
>>> on mouseUp
>>> set the numberFormat to "0.00"
>>> put 1.00+1 into tpoextprice
>> put tpoextprice
>>> end mouseUp
>>> At this point tpoextprice is 2. Not mind you, 2.00, just 2.
>> Adding this, will put 2.00 into the message box. LC 8.1.9, Mac.
>> So maybe the debugger does just not display the correct number?
>>> Either I am missing something (again) or else numberFormat is broken.
>>> Bob S
>> Klaus Major
>> klaus at major-k.de
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode