[#BloombergLP-bdljsn-JsonNumber]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::JsonNumber
:relfileprefix: ../../
:mrdocs:

This class defines a value&hyphen;semantic type that represents a JSON number&period;

== Synopsis

Declared in `&lt;bdljsn&lowbar;jsonnumber&period;h&gt;`

[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&period; The value can be specified by supplying a string that conforms to the &lcub;JSON Textual Specification&rcub; or from one of the &lcub;Supported Types&rcub;&period; The value of a JSON object can be converted to any of those types&semi; however, some of those conversions can be inexact&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias for `allocator&lowbar;type`&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/JsonNumber/_04enum.adoc[`Unnamed enum`] 
| Undocumented symbol&period;
|===


== 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&equals;`] 
| Assignment operators
| xref:BloombergLP/bdljsn/JsonNumber/allocator.adoc[`allocator`]  [.small]#[deprecated]#
| *DEPRECATED*&colon; Use `get&lowbar;allocator()` instead&period;
| xref:BloombergLP/bdljsn/JsonNumber/asDecimal64.adoc[`asDecimal64`] 
| Same as the related overload above for `asDecimal64`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asDecimal64Exact.adoc[`asDecimal64Exact`] 
| Load into `result` the closest `Decimal64` representation&period;
| xref:BloombergLP/bdljsn/JsonNumber/asDouble.adoc[`asDouble`] 
| Same as the related overload above for `asDouble`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asFloat.adoc[`asFloat`] 
| Return the closest floating point representation to this number&period;
| xref:BloombergLP/bdljsn/JsonNumber/asInt.adoc[`asInt`] 
| Same as the related overload above for `asInt`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asInt64.adoc[`asInt64`] 
| Same as the related overload above for `asInt64`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asLong.adoc[`asLong`] 
| Same as the related overload above for `asLong`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asLonglong.adoc[`asLonglong`] 
| Same as the related overload above for `asLonglong`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asShort.adoc[`asShort`] 
| Load into the specified `result` the integer value of this number&period;
| xref:BloombergLP/bdljsn/JsonNumber/asUint.adoc[`asUint`] 
| Same as the related overload above for `asUint`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asUint64.adoc[`asUint64`] 
| Same as the related overload above for `asUint64`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asUlong.adoc[`asUlong`] 
| Same as the related overload above for `asUlong`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asUlonglong.adoc[`asUlonglong`] 
| Same as the related overload above for `asUlonglong`&period;
| xref:BloombergLP/bdljsn/JsonNumber/asUshort.adoc[`asUshort`] 
| Same as the related overload above for `asUshort`&period;
| xref:BloombergLP/bdljsn/JsonNumber/get_allocator.adoc[`get&lowbar;allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bdljsn/JsonNumber/isEqual.adoc[`isEqual`] 
| Return `true` if this number and `other` represent the same value&period;
| xref:BloombergLP/bdljsn/JsonNumber/isIntegral.adoc[`isIntegral`] 
| Return `true` if the value of this `JsonNumber` is an exact integer&period;
| xref:BloombergLP/bdljsn/JsonNumber/print.adoc[`print`] 
| Write the value of this object to the specified output `stream`&period;
| xref:BloombergLP/bdljsn/JsonNumber/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with that of `other`&period;
| xref:BloombergLP/bdljsn/JsonNumber/value.adoc[`value`] 
| Return the textual representation of this `JsonNumber`&period;
| xref:BloombergLP/bdljsn/JsonNumber/2conversion-03b.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;JsonNumber, IsBitwiseMoveable&gt;`] 
| Declare nested type traits for this type&period;
| xref:BloombergLP/bdljsn/JsonNumber/2conversion-0e.adoc[`operator bdldfp::Decimal64`] 
| Same as the related overload above for `operator Decimal&lowbar;Type64`&period;
| xref:BloombergLP/bdljsn/JsonNumber/2conversion-0f.adoc[`operator double`] 
| Same as the related overload above for `operator double`&period;
| xref:BloombergLP/bdljsn/JsonNumber/2conversion-03d.adoc[`operator float`] 
| Return the closest floating point representation to this number&period;
|===


== 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&period;
|===


== 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&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/operator_not_eq-010.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-059.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` do not have the same value&period;
| xref:BloombergLP/bdljsn/operator_eq-0a8.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0fe.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` have the same value&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
