Coder Social home page Coder Social logo

Grouping about pprintpp HOT 3 CLOSED

tfc avatar tfc commented on June 12, 2024
Grouping

from pprintpp.

Comments (3)

tfc avatar tfc commented on June 12, 2024

Hello @cup, thank you for opening an issue. Unfortunately, i don't know what to do with your comment.

Do you wish to have grouping support in pprintpp, too? If so, please understand that pprintpp is only a frontend for whatever printf implementation you use. That means, that if your printf implementation has no grouping support, then pprintpp will not be able to change that as it is not designed to do that.

Or do you have a printf implementation that supports grouping, but it does not work well in combination with pprintpp? If yes, and you wish for assistance fixing that, then i can help you best if you provide the exact format schema that pprintpp would need to generate from given inputs.

from pprintpp.

 avatar commented on June 12, 2024

@tfc for the purpose of this issue, lets assume that all printf have grouping support. Now thats settled, how to do grouping with pprintpp?

from pprintpp.

tfc avatar tfc commented on June 12, 2024

Hey @cup,

i just looked up how grouping in POSIX printf works:

#include <locale.h>
#include <stdio.h>

int main() {
    setlocale(LC_ALL, ""); /* use user selected locale */
    printf("%'d", 1000000);
}

with pprintpp it works out of the box:

#include <pprintpp.hpp>

#include <clocale>
#include <cstdio>

int main() {
    setlocale(LC_ALL, ""); /* use user selected locale */
    pprintf("{'}", 1000000);
}

In both cases, the output is 1,000,000.

from pprintpp.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.