Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: A locale independent sprintf?

by kcott (Archbishop)
on Jul 29, 2020 at 09:05 UTC ( [id://11119949]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
        y_sprintf => sub { my $str = sprintf('%.2g', 3.14) =~ y/./,/r; ret
    +urn $str; },
        s_sprintf => sub { my $str = sprintf('%.2g', 3.14) =~ s/\./,/r; re
    +turn $str; },
    };
    
  2. or download this
    $ ./pm_11119934_bench_locale_s_y.pl
    en_AU.UTF-8
    ...
    s_sprintf  2940825/s        --      -46%      -85%
    y_sprintf  5493603/s       87%        --      -72%
    sprintf   19713322/s      570%      259%        --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119949]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found