Negative Numbers and NumberFormat

hh hh at hyperhh.de
Mon Apr 3 19:55:57 EDT 2017


> Bob S. worte:
> I have a function for calculating the difference in time

Then you mean -(01:00:00) and not (-01):(00):(00), quite different.

AFAIK most languages do such time evaluations as follows
1) compute the time in seconds,
2) convert its absolute value to time format, and
3) if negative, put "-" before the formatted time.
That is, the whole display is not an immediate result of setting the
number format.

> You should rather say the number format determines the num of DIGITS.

That's what you wish to have (good idea). But it's not like that, its
the length of the number as string. You gave the proof yourself.
It's the same with the number formats from format(). Probably LC uses
internally format() for its numberFormat.




More information about the use-livecode mailing list