AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::val::FractionDigits Struct Reference

Maximum number of fraction digits constraint (XSD fractionDigits facet). More...

#include <constraints.hpp>

Collaboration diagram for anch::val::FractionDigits:

Public Member Functions

template<typename V>
requires (anch::val::Number<V> || anch::val::StringLike<V>)
bool check (const V &decimal, std::string &message) const

Public Attributes

std::size_t value

Detailed Description

Maximum number of fraction digits constraint (XSD fractionDigits facet).

Digits are counted as TotalDigits does (trailing zeros are not counted): integers have no fraction digit.

Author
Vincent Lachenal
Since
0.3

Member Function Documentation

◆ check()

template<typename V>
requires (anch::val::Number<V> || anch::val::StringLike<V>)
bool anch::val::FractionDigits::check ( const V & decimal,
std::string & message ) const

Check value

Template Parameters
Vthe value type (number or decimal string)
Parameters
decimalthe value
messagethe error message (set when value is invalid)
Returns
true when value is valid

Member Data Documentation

◆ value

std::size_t anch::val::FractionDigits::value

Maximum number of fraction digits


The documentation for this struct was generated from the following file: