in reply to Re: Extract last two digits from numbers
in thread Extract last two digits from numbers

my $number = '3204'; $number %= 100; print $number; 4

Abigail

Replies are listed 'Best First'.
Re: (2) Extract last two digits from numbers
by BrowserUk (Patriarch) on Jan 06, 2004 at 11:24 UTC

    Good point. I guess it depends on whether the OP wants two characters or the numeric value of the last two digits.

    Without clarification, my interpretation is probably the least likely given context.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!