Formating numbers in fields

Richmond Mathewson richmondmathewson at gmail.com
Thu Mar 11 11:10:12 EST 2010


  On 11/03/2010 17:57, Andrew Kluthe wrote:
> I have been over alot of the other formatting threads on the list and can't
> exactly find what I am looking for.
>
> Basically, I have a field that is supposed to have the number format "#.##"
> in it. I want to set it up so that you can enter as many numbers as you want
> before the decimal but after the decimal it only shows and allows you to
> enter two numbers. I have tried doing this several ways and just cannot come
> up with one that works as it should. This should be simple for the code
> guerrillas on this list.
>
> the logic I have pinned down so far.
>
> on keydown
>   if "." is in the field and if "." key is being pressed don't pass keydown
> if "." is in the field then check to see if "." is in char -3
> if "." is not in char -3 then ?
> end keydown
>
>
> Serious brainfart. halp?
>
> Andrew Kluthe
>
>
I'm only a code gorilla  . . .   :)

numberFormat

Love, Richmond.



More information about the use-livecode mailing list