[#BloombergLP-bdljsn-JsonNumber-2constructor-0e6]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonNumber.adoc[JsonNumber]::JsonNumber
:relfileprefix: ../../../
:mrdocs:

Create a `JsonNumber` having the same value as the specified `text`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
JsonNumber(
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;bsl::string&gt;] text,
    xref:BloombergLP/bdljsn/JsonNumber/allocator_type.adoc[allocator&lowbar;type] const& allocator);
----

== Description

Use the specified `allocator` (e&period;g&period;, the address of a `bslma&colon;&colon;Allocator` object) to supply memory&period; The allocator of the `text` string remains unchanged&period; If the `text` and the newly created object have the same allocator then the contents of `text` string becomes unspecified but valid, and no exceptions will be thrown&semi; otherwise the `text` string is unchanged and an exception may be thrown&period; The behavior is undefined unless `isValidNumber(text)` is `true`&period; See &lcub;JSON Textual Specification&rcub;&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *text*
| JSON number text to move from
| *allocator*
| allocator used to supply memory
|===


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