cgv
Loading...
Searching...
No Matches
cgv::utils::number_format Class Reference

A class to store number formatting specification and allow converting numbers to strings. More...

#include <number_format.h>

Public Member Functions

std::string convert (float value) const
 
void precision_from_range (float first, float last)
 

Public Attributes

unsigned precision = 0
 
bool decimal_integers = false
 
bool fixed = true
 
bool trailing_zeros = true
 
int group_size = 3
 
std::string group_separator = ","
 
bool grouping = false
 

Detailed Description

A class to store number formatting specification and allow converting numbers to strings.

Definition at line 11 of file number_format.h.

Member Function Documentation

◆ convert()

std::string cgv::utils::number_format::convert ( float  value) const

Definition at line 11 of file number_format.cxx.

◆ precision_from_range()

void cgv::utils::number_format::precision_from_range ( float  first,
float  last 
)

Definition at line 44 of file number_format.cxx.

Member Data Documentation

◆ decimal_integers

bool cgv::utils::number_format::decimal_integers = false

Definition at line 18 of file number_format.h.

◆ fixed

bool cgv::utils::number_format::fixed = true

Definition at line 19 of file number_format.h.

◆ group_separator

std::string cgv::utils::number_format::group_separator = ","

Definition at line 22 of file number_format.h.

◆ group_size

int cgv::utils::number_format::group_size = 3

Definition at line 21 of file number_format.h.

◆ grouping

bool cgv::utils::number_format::grouping = false

Definition at line 23 of file number_format.h.

◆ precision

unsigned cgv::utils::number_format::precision = 0

Definition at line 17 of file number_format.h.

◆ trailing_zeros

bool cgv::utils::number_format::trailing_zeros = true

Definition at line 20 of file number_format.h.


The documentation for this class was generated from the following files: