Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:22:32+00:00 2026-06-13T10:22:32+00:00

I’m using this print statement: printf( %5.2lf %’15llu %’13llu %5.2lf %’15llu %’11u %’11u %’11u

  • 0

I’m using this print statement:

printf(
 "%5.2lf %'15llu %'13llu %5.2lf %'15llu "
 "%'11u %'11u %'11u %'11u %'11u %'11u %'11u %'11u %'11u %'11u "
 "%'11u %'9u %'11u %'9u\n",
 (p->cbDecomp) ? 100.0 * ((double)p->cbComp)/p->cbDecomp : 0, p->cbDecomp, p->cbComp, 
 (p->cbDecompDup) ? 100.0 * ((double)p->cbComp)/p->cbDecompDup : 0, p->cbDecompDup, 
 p->cbIndFile, p->cbUdhFile, p->cUid, p->cFreeUid, p->cDups, cbUid, cbUdh, p->cTbl, p->cTblDel, cbTbl,
 p->cTblBuckets, p->cMaxTblInBucket, p->cUdhBuckets, p->cMaxUdhInBucket);

But getting this output:

  atp 001  0.39      1094017024       4281732  0.39      1110155264     9111191     7510837      267094           0        3940     1335470     3205128      352190           0     3521900      131072        13      131072        11
  atp 002  0.33        40898560        133896  0.33        40935424      355600      253716        9985           0           9       49925      119820       15297           0      152970        4096        13        4096         9
  atp 003  0.38       690307072       2640414  0.38       694116352     5763359     4680853      168532           0         930      842660     2022384      237391           0     2373910       65536        15       65536        11
  atp 004  0.70       661450752       4613727  0.69       667181056     5614000     6574177      161487           0        1399      807435     1937844      277030           0     2770300       16384        33        8192        42

The commas separating the thousands groups are not showing up! I think it has something to do with locale, but I don’t know anything about locale.

[c698174@shldvgfas023] $ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

[c698174@shldvgfas023] $ cat /proc/version 
Linux version 2.6.32-236.el6.sf599499.x86_64 (mockbuild@x86-012.build.bos.redhat.com) (gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) ) #1 SMP Thu May 10 12:52:20 EDT 2012

Does anyone know how to get my commas???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:22:33+00:00Added an answer on June 13, 2026 at 10:22 am

    Set your locale first.

    #include <stdio.h>
    #include <locale.h>
    int main(int argc, char *argv[])
    {
        printf("%'d\n", 1000000);
        setlocale(LC_ALL, "");
        printf("%'d\n", 1000000);
        return 0;
    }
    

    Output:

    $ ./a.out 
    1000000
    1,000,000
    

    The setlocale(LC_ALL, "") call will set the current locale according to the environment variables. The thousands separator is locale-specific.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.