Getting the number of decimal places: Difference between revisions
Content added Content deleted
m (added ;Task: and 'Examples:, added highlighting, and added whitespace before the TOC.) |
(→{{header|Java}}: Rescued Julia example.) |
||
Line 104: | Line 104: | ||
if(str.endsWith(".0")) return 0; |
if(str.endsWith(".0")) return 0; |
||
else return (str.substring(str.indexOf('.')).length() - 1); |
else return (str.substring(str.indexOf('.')).length() - 1); |
||
}</lang> |
|||
} |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |