Hi, I thought this would be easy but no. Basically I would like to be able to format a number to display a currency in this case dollar ex. $123.45
I read the information in dictionary and search thru the forum for number formatting and glance thru apps examples with not much success. Any help on this would be appreciated, tutorial, guide to read anything. I build a test stack to see how formatting would work. The example below does not give me an error but if I enter 123.4567 I get 123.4567 in both cases.TIA
on mouseUp
set the numberformat to "0.00"
ask "enter a number"
put it into field "mine"
answer it
end mouseUp
number formatting
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: number formatting
Hi byg,
Here is the funny little line in the dictionary that gets overlooked:
I think this will do it:
on mouseUp
set the numberformat to "0.00"
ask "enter a number"
add 0 to it
put it into field "mine"
answer it
end mouseUp
Here is the funny little line in the dictionary that gets overlooked:
Note the last 5 wordsUse the numberFormat property to specify the results of numeric calculations,

I think this will do it:
on mouseUp
set the numberformat to "0.00"
ask "enter a number"
add 0 to it
put it into field "mine"
answer it
end mouseUp
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: number formatting
Hi right back to you.
An oldie but goodie. The numberformat property will not express itself unless an arithmetic operation is performed first. Try this:
The addition seems superfluous, and in every sense except making the format work, it is.
Craig Newman
An oldie but goodie. The numberformat property will not express itself unless an arithmetic operation is performed first. Try this:
Code: Select all
on mouseUp
set the numberformat to "0.00"
ask "enter a number"
answer it + 0
end mouseUp
Craig Newman
Re: number formatting
hI to both of you , amazingly simple when you know it, "overlook" is right , thanks all.
byg
byg