Getting the number of decimal places: Difference between revisions

Content added Content deleted
(Added Perl example)
m (→‎{{header|REXX}}: added wording to the REXX section header.)
Line 370: Line 370:


=={{header|REXX}}==
=={{header|REXX}}==
Since the REXX language stores numbers as strings,   the issue of trailing zeros is a moot point.
<br>If the number (as specified) has trailing zeros, there are left intact.

Any number specified in exponential notation is first converted to a whole or fractional integer, &nbsp; and
<brr>that number is then examined.
<lang rexx>/*REXX pgm counts number of decimal digits which are to the right of the decimal point. */
<lang rexx>/*REXX pgm counts number of decimal digits which are to the right of the decimal point. */
numeric digits 1000 /*ensure enuf dec digs for calculations*/
numeric digits 1000 /*ensure enuf dec digs for calculations*/