Dear fellow monks,

I need some functions to output numbers, dates, and times in a locale-dependent way with some predefined formats. I just want to specify the locale and one of these general formats: "number with 2 digits after decimal", "money with 2 digits after decimal", "short date", "medium date", "long date", "time without seconds", "time with seconds". The routines should handle/pick the formatting details that make sense for me.

For example time can perhaps be in 12-hour or 24-hour format, with different separator according to the locale: 11:22 PM or 23:22 or even 23h22. Short date output could perhaps be something like 2007.12.31 or 12/31/2007, numbers could be "23 000 000.00" or "23.000.000,00", etc. Basically I could care less as long as it is the common format for that locale.

Any module to do that?


In reply to simple locale-dependent output functions? by Anonymous Monk

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.