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

Getting Started with LiveCode - Complete Beginners • Re: Number Format (decimal,comma)

$
0
0
Hi.

CODE:

on mouseUp   ask "enter a number" with "12324567.89"   if it is a number then      set the itemDel to "."      put item 1 of it into temp      if item 2 of it <> "" then put "." & item 2 of it into decimal else put "" into decimal            repeat with y = the number of chars of temp down to 1 step -3         if y = the number of chars of temp then next repeat          put comma before char y + 1 of temp      end repeat      if char 1 of temp = comma then delete char 1 of temp     answer temp &  decimal    end ifend mouseUp
Craig

Statistics: Posted by dunbarx — Wed Jul 10, 2024 2:56 pm



Viewing all articles
Browse latest Browse all 672

Trending Articles