Please save yourself some effort in future and use <code> ... </code> tags; please see Markup in the Monastery and Writeup Formatting Tips.
my $n=$number/10000;
$n=~s/\..*//;
The purpose of the s/\..*// substitution seems to to be to truncate a number to an integer. The built-in function int exists for this purpose
my $n = int($number/10000);
or one could simply put a useinteger; statement at the beginning of one's code and all arithmetic operations thereafter will be integer operations:
use warnings; use strict; use integer; ... my $n = $number/10000; ... my $n = $number/1000; ...
Give a man a fish: <%-{-{-{-<
In reply to Re: english numbers to chinese numbers
by AnomalousMonk
in thread english numbers to chinese numbers
by changlehu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |