Subject: Re: Don't amputate numberformat

Richard Gaskin ambassador at fourthworld.com
Mon Apr 24 11:30:36 EDT 2017


Mike Kerner wrote:

 > Well, that would be a nice thing to have in a field widget, but I run
 > into formatting issues with databases, as well, especially when
 > sorting.

The DB issue may be best handled through an accessor library.  Many 
other error-correction and conveniences could be added to that as well.

But with fields, a formatting enhancement need not be a Widget per se. 
That would require first reproducing the entire field object, and then 
adding the small bits we're discussing here.  Daunting.

Simpler would be a behavior script, with a custom properties called 
something like "rawText" and "displayText", with formatting determined 
by "displayFormat", e.g.:

set the displayFormat of fld 1 to "$0.00"
set the rawText of fld 1 to 5 -- shows "$5.00"
get the displayText of fld 1 -- returns "$5.00"
get the rawText of fld 1 -- return "5"

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list