Make numberFormat even better

Mark Waddingham mark at livecode.com
Tue Apr 25 12:29:08 EDT 2017


On 2017-04-25 12:48, Lagi Pittas via use-livecode wrote:
> Hi
> 
> I don't know why you want to adapt/enhance the number format as that 
> could
> break already working code that uses the nuances of numberformat 
> already.

Although it may have not been 100% clear in my previous post, as 
numberFormat
in LiveCode is just string formatting (it doesn't do what it does in 
HyperCard
where it also controls numerical precision of each arithmetic operation) 
it can be
extended without affecting existing code.

> Why not add an instruction NumberFormatXL and create the an Excel 
> version
> like Curry says. You won't have to jump through hoops to make sure it
> doesn't break anything, you can fix what's wrong(?) and you can add 
> stuff
> in there without affecting old code, plus and with Curry's experience 
> with
> spreadlib you probably have a lot of the problems to solve sorted.

When would numberFormatXL be used instead of numberFormat? I presume if 
it has
been explicitly set in local context... In which case...

There's no point in introducing a new property whose only action is to 
subsume
the action of the previous one since that is equivalent to just 
extending the
original property.

Warmest Regards,

Mark.

P.S. The main suggestion in my previous post wasn't about numberFormat 
per-se
more about restricting its domain slightly (to things which are not 
integers)
in order to (1) solve a problem with numeric representation (wouldn't it 
be nice
to have infinite precision integers?) and (2) make the language more 
ergonomic
when dealing with numeric arrays - allowing to use 'numberFormat'
(or whatever) *and* numeric arrays.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list