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 7998567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:14:42+00:00 2026-06-04T15:14:42+00:00

Possible Duplicate: Inserting and removing commas from integers in c++ I want to write

  • 0

Possible Duplicate:
Inserting and removing commas from integers in c++

I want to write double values with the decimal separator as in the current locale, but I do not want it grouped by the grouping character from the current locale. The current approach with

stringstream s;
s.imbue(std::locale(""));

solves only one of the issues. The current output is like 1,234.567 instead of the wanted 1234.567

How can I change this?

  • 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-04T15:14:44+00:00Added an answer on June 4, 2026 at 3:14 pm

    with the help of dirkgently’s post inserting and removing commas from integers, I created the following class:

    class no_grouping : public std::numpunct_byname<char> {
        std::string do_grouping() const { return ""; }
    
    public:
        no_grouping() : numpunct_byname("") {}
    };
    

    Important here is to derive from numpunkct_byname and initialize it with the constructor parameter “” for the local locale.

    Then the stream can easily be imbued with the following code:

    ostringstream stringBuff;
    std::locale locale(std::locale(""),new no_grouping);
    stringBuff.imbue(locale);
    

    this will remove the grouping, but it will take the decimal separator from the local locale.

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

Sidebar

Related Questions

Possible Duplicate: How do I stop visual studio from automatically inserting asterisk during a
Possible Duplicate: android calendar delete event Actually i write a code for inserting and
Possible Duplicate: strong-typed profile values in ASP.NET membership (MVC) Currently i am inserting data
Possible Duplicate: php/Mysql query with inserting date fails I have a datepicker code below:
Possible Duplicate: Working with latitude/longitude values in Java Duplicate: Working with latitude/longitude values in
Possible Duplicate: Extracting dollar amounts from existing sql data? I have a column in
Possible Duplicate: Dynamically creating/inserting into an associative array in PHP I have the following
Possible Duplicate: Inserting new table row after the first table row using JQuery I
Possible Duplicate: Inserting a Java string in another string without concatenation? In Object C
Possible Duplicate: (mysql, php) How to get auto_increment field value before inserting data? I

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.