keyInField

Jan Schenkel janschenkel at yahoo.com
Thu Sep 26 11:53:01 EDT 2002


Hi Yves,

It's definitely possible, and you can accomplish it by
adapting the script I provided a few days ago for
inserting commas.
Relevant link to the use-revolution archive:
http://lists.runrev.com/pipermail/use-revolution/2002-September/008009.html

Simply change the last line of insertCommas from
  return tMinusHold & pNumber & tDecimalHold
to the following code
  put tMinusHold & pNumber & tDecimalHold into \
  tResult
  replace "," with " " in tResult
  replace "." with "," in tResult
  return tResult

The problem with that, however, is that when the user
enters the field again, the data won't be seen as
"numeric" as MC/RR evaluates an expression as a number
only if it's in the decimal-point-without-commas
format.

Of course you could change it back to numeric format
on openField, but that would be confusing to the user
to say the least...
It's on my to-do list to figure out a good way to
handle that. My main focus was on preventing the
typing and/or pasting of unwanted characters.

Best regards,

Jan Schenkel.

"As we grow older, we grow both wiser and more foolish
at the same time."

--- yves COPPE <yvescoppe at skynet.be> wrote:
> Hi Jan
> 
> 
> in your script for numeric fld, I've understood that
> you can change 
> the numbers after the decimal with
> 
> 
>    put format("%16.3f", tNumber) into tFormatted
> 
> if we change .3f with .2f, it gives 2 numbers after
> decimal.
> 
> Now : 2 problems :
> 
> 1) I'd like the separator of decimal is a comma and
> not a point.
> is it possible ?
> 
> 2) I' d like a separator for the thousands (a space
> for example)
> 
> 
> so : 123456789 ->  1 234 567,89
> 
> can you insert that in your script ?
> 
> thanks.
> 
> -- 
> Greetings.
> 
> Yves COPPE
> 
> Email : yvescoppe at skynet.be
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
>
http://lists.runrev.com/mailman/listinfo/use-revolution


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the use-livecode mailing list