mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 23:20:05 +02:00
Add setting precision for json writers and also add decimal places precision type. (#752)
* Added setting precision for writers. * Added special case for precise precision and global precision. * Added good setting of type of precision and also added this type to BuiltStreamWriter and for its settings. * Added some tests.
This commit is contained in:
@@ -109,6 +109,13 @@ enum CommentPlacement {
|
||||
numberOfCommentPlacement
|
||||
};
|
||||
|
||||
/** \brief Type of precision for formatting of real values.
|
||||
*/
|
||||
enum PrecisionType {
|
||||
significantDigits = 0, ///< we set max number of significant digits in string
|
||||
decimalPlaces ///< we set max number of digits after "." in string
|
||||
};
|
||||
|
||||
//# ifdef JSON_USE_CPPTL
|
||||
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
|
||||
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
|
||||
@@ -220,6 +227,9 @@ public:
|
||||
static const UInt64 maxUInt64;
|
||||
#endif // defined(JSON_HAS_INT64)
|
||||
|
||||
/// Default precision for real value for string representation.
|
||||
static const UInt defaultRealPrecision;
|
||||
|
||||
// Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler
|
||||
// when using gcc and clang backend compilers. CZString
|
||||
// cannot be defined as private. See issue #486
|
||||
|
Reference in New Issue
Block a user