[#BloombergLP-bdljsn-JsonNumber] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::JsonNumber :relfileprefix: ../../ :mrdocs: This class defines a value‐semantic type that represents a JSON number. == Synopsis Declared in `<bdljsn_jsonnumber.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class JsonNumber; ---- == Description Objects of this class have a value determined at construction and does not change except by assignment from or swap with another `JsonNumber` object. The value can be specified by supplying a string that conforms to the {JSON Textual Specification} or from one of the {Supported Types}. The value of a JSON object can be converted to any of those types; however, some of those conversions can be inexact. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[`allocator_type`] | This `typedef` is an alias for `allocator_type`. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonNumber/_04enum.adoc[`Unnamed enum`] | Undocumented symbol. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonNumber/2constructor-031.adoc[`JsonNumber`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdljsn/JsonNumber/operator_assign-0ad.adoc[`operator=`] | Assignment operators | xref:BloombergLP/bdljsn/JsonNumber/allocator.adoc[`allocator`] [.small]#[deprecated]# | *DEPRECATED*: Use `get_allocator()` instead. | xref:BloombergLP/bdljsn/JsonNumber/asDecimal64.adoc[`asDecimal64`] | Same as the related overload above for `asDecimal64`. | xref:BloombergLP/bdljsn/JsonNumber/asDecimal64Exact.adoc[`asDecimal64Exact`] | Load into `result` the closest `Decimal64` representation. | xref:BloombergLP/bdljsn/JsonNumber/asDouble.adoc[`asDouble`] | Same as the related overload above for `asDouble`. | xref:BloombergLP/bdljsn/JsonNumber/asFloat.adoc[`asFloat`] | Return the closest floating point representation to this number. | xref:BloombergLP/bdljsn/JsonNumber/asInt.adoc[`asInt`] | Same as the related overload above for `asInt`. | xref:BloombergLP/bdljsn/JsonNumber/asInt64.adoc[`asInt64`] | Same as the related overload above for `asInt64`. | xref:BloombergLP/bdljsn/JsonNumber/asLong.adoc[`asLong`] | Same as the related overload above for `asLong`. | xref:BloombergLP/bdljsn/JsonNumber/asLonglong.adoc[`asLonglong`] | Same as the related overload above for `asLonglong`. | xref:BloombergLP/bdljsn/JsonNumber/asShort.adoc[`asShort`] | Load into the specified `result` the integer value of this number. | xref:BloombergLP/bdljsn/JsonNumber/asUint.adoc[`asUint`] | Same as the related overload above for `asUint`. | xref:BloombergLP/bdljsn/JsonNumber/asUint64.adoc[`asUint64`] | Same as the related overload above for `asUint64`. | xref:BloombergLP/bdljsn/JsonNumber/asUlong.adoc[`asUlong`] | Same as the related overload above for `asUlong`. | xref:BloombergLP/bdljsn/JsonNumber/asUlonglong.adoc[`asUlonglong`] | Same as the related overload above for `asUlonglong`. | xref:BloombergLP/bdljsn/JsonNumber/asUshort.adoc[`asUshort`] | Same as the related overload above for `asUshort`. | xref:BloombergLP/bdljsn/JsonNumber/get_allocator.adoc[`get_allocator`] | Return the allocator used by this object to supply memory. | xref:BloombergLP/bdljsn/JsonNumber/isEqual.adoc[`isEqual`] | Return `true` if this number and `other` represent the same value. | xref:BloombergLP/bdljsn/JsonNumber/isIntegral.adoc[`isIntegral`] | Return `true` if the value of this `JsonNumber` is an exact integer. | xref:BloombergLP/bdljsn/JsonNumber/print.adoc[`print`] | Write the value of this object to the specified output `stream`. | xref:BloombergLP/bdljsn/JsonNumber/swap.adoc[`swap`] | Efficiently exchange the value of this object with that of `other`. | xref:BloombergLP/bdljsn/JsonNumber/value.adoc[`value`] | Return the textual representation of this `JsonNumber`. | xref:BloombergLP/bdljsn/JsonNumber/2conversion-03b.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<JsonNumber, IsBitwiseMoveable>`] | Declare nested type traits for this type. | xref:BloombergLP/bdljsn/JsonNumber/2conversion-0e.adoc[`operator bdldfp::Decimal64`] | Same as the related overload above for `operator Decimal_Type64`. | xref:BloombergLP/bdljsn/JsonNumber/2conversion-0f.adoc[`operator double`] | Same as the related overload above for `operator double`. | xref:BloombergLP/bdljsn/JsonNumber/2conversion-03d.adoc[`operator float`] | Return the closest floating point representation to this number. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonNumber/isValidNumber.adoc[`isValidNumber`] | Return `true` if the specified `text` complies with the grammar of a JSON number, and `false` otherwise. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdljsn/swap-088.adoc[BloombergLP::bdljsn::swap]` | Exchange the values of the specified `a` and `b` objects. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/operator_not_eq-010.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-059.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` do not have the same value. | xref:BloombergLP/bdljsn/operator_eq-0a8.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0fe.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` have the same value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#