Sorry, but yes. It doesn't handle decimal places. Works well on integers though.

C:\test>commify -0.0001234567890 commified becomes -0.000,123,456,789 -0.0012345678900 commified becomes -0.00,123,456,789 -0.0123456789000 commified becomes -0.0,123,456,789 -0.1234567890000 commified becomes -0.123,456,789 -1.2345678900000 commified becomes -1.23,456,789 -12.3456789000000 commified becomes -12.3,456,789 -123.4567890000000 commified becomes -123.456,789 -1234.5678900000000 commified becomes -1,234.56,789 -12345.6789000000010 commified becomes -12,345.6,789 -123456.7890000000000 commified becomes -123,456.789 -1234567.8899999999000 commified becomes -1,234,567.89 -12345678.9000000000000 commified becomes -12,345,678.9 -123456789.0000000000000 commified becomes -123,456,789 -1234567890.0000000000000 commified becomes -1,234,567,890 -12345678900.0000000000000 commified becomes -12,345,678,900 -123456789000.0000000000000 commified becomes -123,456,789,000 -1234567890000.0000000000000 commified becomes -1,234,567,890,000 -12345678900000.0000000000000 commified becomes -12,345,678,900,000 -123456789000000.0000000000000 commified becomes -123,456,789,000,000 -1234567890000000.0000000000000 commified becomes -1.23456789e+015 C:\test>

Examine what is said, not who speaks.


In reply to Re: Re: "Commifying" a number by BrowserUk
in thread "Commifying" a number by Tanalis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.