Numberformat

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Aug 26 15:48:24 EDT 2008


Hi David,

I tried the following script:

on mouseUp
    beep
    put 1,8 into someDate
    set the numberformat to "00.######"
    put item 1 of someDate + 0 into y
    put item 2 of someDate + 0 into someMonth
    put y & cr & someMonth
end mouseUp

which gives me

01
08

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
http://facebook.economy-x-talk.com

Benefit from our inexpensive hosting services. See http://economy-x-talk.com/server.html 
  for more info.

On 26 aug 2008, at 21:31, David Bovill wrote:

> I can never get this working... or has something changed? I want a  
> number
> formatted to 2 chars and padded with leading zeros if it is only 1  
> digit. I
> thought numberformat did this (for containers as well as fields by  
> forcing a
> calculation by adding zero. So:
>
>    set the numberformat to "00.######"
>    put item 1 of someDate + 0 into y
>    put item 2 of someDate + 0 into someMonth
>
> Well its not working now. I get "8" instead of "08" for this month?




More information about the use-livecode mailing list