Getting the number of decimal places: Difference between revisions
Getting the number of decimal places (view source)
Revision as of 16:19, 17 September 2020
, 3 years agoAdded AutoHotkey
m (→{{header|REXX}}: added wording to the REXX section header.) |
Alpha bravo (talk | contribs) (Added AutoHotkey) |
||
Line 11:
=={{header|AutoHotkey}}==
<lang AutoHotkey>for i, v in [10, "10", 12.345, "12.345", 12.3450, "12.3450"]
output .= v " has " StrLen(StrSplit(v, ".").2) " decimals.`n"
MsgBox % output</lang>
{{out}}
<pre>10 has 0 decimals.
10 has 0 decimals.
12.345 has 3 decimals.
12.345 has 3 decimals.
12.3450 has 4 decimals.
12.3450 has 4 decimals.</pre>
=={{header|Go}}==
|