Troubles with inequality

Graham Samuel livfoss at mac.com
Wed Feb 4 16:01:18 EST 2015


Fascinating! Up to this moment, it seemed to me that the **appearance** of a number in a variable or more particularly in a field, **is** the number - where is the space where the engine can put an extended value? Is there something hidden in the object, perhaps in word 2? I mean, I have always thought that setting the numberFormat ensured that the result of a subsequent calculation was in effect a character string whose length was determined by the numberFormat setting. From your code, it seems this is not the case. I don’t think this issue is tackled at all in the LC Dictionary, tho I may be wrong, as I have been about everything else on this topic.

So really, if I want an uncomplicated string of characters derived from a number via setting the numberFormat and then doing a calculation, how do I get it? Do I have to copy out the characters of Word 1 one by one?

Graham



> On 4 Feb 2015, at 16:14, Colin Holgate <coiin at verizon.net> wrote:
> 
> The numberformat only affect the appearance of the number, not its value. If you want to compare them based on the appearance characters, you can compare them as strings instead of numbers. Try this:
> 
> on mouseUp
>   put 1.234567 into temp
>   put 1.2345678 into aa
>   set the numberFormat to "0.###"
>   put temp * 1 into temp
>   put aa * 1 into aa
>   answer aa = temp
>   answer word 1 of aa = word 1 of temp
>   answer word 1 of aa
> end mouseUp
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list