Trying a custom handler for several math fields

Richard Gaskin ambassador at fourthworld.com
Sat Sep 14 12:43:31 EDT 2013


dunbarx wrote:

 > If you simply enter "$50" in an excel cell and then add that cell
 > plus "3" to another cell, it works fine. No explicit currency
 > formatting needed. I think you said this. Excel has this knowledge
 > built-in, Try it with "#50". But that only means that Excel
 > understands the "$" sign, helping the user with a shortcut.
 >
 >
 > LiveCode does not, because it simply sees three characters in that
 > "$50" string and takes it at face value.

I think the key here is that Excel separates the stored value from its 
display representation, while doing this in LC requires some scripting.

It would be ideal if we could have a displayFormat property for fields 
and chunks, so that we could set it to something like "$0.00" and then 
putting "2.4" into the field would cause the field to render as "$2.40". 
  Likewise we would want to be able to set the displayFormat for columns 
in multi-column list fields.

Until such time as the engine may ever have such a feature (useful as it 
would be, I've never seen it on a roadmap), we can get a similar outcome 
with a well-crafted behavior script.

A really good script would take some effort to produce, but would be 
very useful to the community.  If someone's in a position to start such 
a project I'd happily contribute to it.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys





More information about the use-livecode mailing list