Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 782

Talking LiveCode • Format a number to show in answer

$
0
0
Hello LC specialists,
It has been a while that i posted something but I am still working with LiveCode and still love it.
However I have the next small issue and cannot seem to solve it.

I have a number e.g. 668642 and I want to show in an Answer command with a thousands seperator like 0,668,642.
I used the following code without the success i hoped for :shock:

CODE:

 on mouseUp pMouseButton   put "668642" into tNumber   set the numberFormat to "#,###,##0."   put (1 * tNumber) into tShowFormattedNumber // need to recalculate to effectuate set the numberFormat   Answer "The formatted number is: " & tShowFormattedNumberend mouseUp
This code which came the closest to what i want gives me the number 000668642 however i want it show me 0,668,642 .
How can i do this?

Regards,

MrCoolLIon (Paul)

Statistics: Posted by mrcoollion — Wed Jun 26, 2024 10:14 am



Viewing all articles
Browse latest Browse all 782

Trending Articles