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

Load `result` with the integer value of this number&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
asShort(short* result) const;
----

== Description

Load into the specified `result` the integer value of the value of type `JsonNumber` held by this object&period; Return 0 on success, `JsonNumber&colon;&colon;k&lowbar;OVERFLOW` if `value` is larger than can be represented by `result`, `JsonNumber&colon;&colon;k&lowbar;UNDERFLOW` if `value` is smaller than can be represented by `result`, and `JsonNumber&colon;&colon;k&lowbar;NOT&lowbar;INTEGRAL` if `value` is not an integral number (i&period;e&period;, there is a fractional part)&period; For underflow, `result` will be loaded with the minimum representable value, for overflow, `result` will be loaded with the maximum representable value, for non&hyphen;integral values `result` will be loaded with the integer part of `value` (truncating the value to the nearest integer)&period; If the result is not an integer and also either overflows or underflows, it is treated as an overflow or underflow (respectively)&period; Note that this operation returns a status value (unlike similar floating point conversions) because typically it is an error if a conversion to an integer results in an inexact value&period; The behavior is undefined unless `isNumber()` returns true&period; Also note that on all supported platforms `bsls&colon;&colon;Types&colon;&colon;Int64` and `bsls&colon;&colon;Types&colon;&colon;Uint64` are, respectively, aliases for `long long` and `unsigned long long`&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| destination for the converted value
|===


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