GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::numpunct::decimal_point,do_decimal_point(3) C++ Standard Libary std::numpunct::decimal_point,do_decimal_point(3)

std::numpunct::decimal_point,do_decimal_point - std::numpunct::decimal_point,do_decimal_point


Defined in header <locale>
public: (1)
char_type decimal_point() const;
protected: (2)
virtual char_type do_decimal_point() const;


1) Public member function, calls the member function do_decimal_point of the most
derived class.
2) Returns the character to be used as the decimal separator between integer and
fractional parts.


The value of type char_type to use as the decimal separator. The standard
specializations of std::numpunct return '.' and L'.'.

// Run this code


#include <iostream>
#include <locale>


struct slash : std::numpunct<char> {
char do_decimal_point() const { return '/'; } // separate with slash
};


int main()
{
std::cout.precision(10);
std::cout << "default locale: " << 1234.5678 << '\n';
std::cout.imbue(std::locale(std::cout.getloc(), new slash));
std::cout << "locale with modified numpunct: " << 1234.5678 << '\n';
}


default locale: 1234.5678
locale with modified numpunct: 1234/5678

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.