JsonValueCreateNumberUnchecked Method

Creates a JsonValue that forcibly treats value as a JSON number, even if it cannot be represented as a valid number in JavaScript.

Definition

Namespace: KGySoft.Json
Assembly: KGySoft.Json (in KGySoft.Json.dll) Version: 3.0.0
C#
public static JsonValue CreateNumberUnchecked(
	string value
)

Parameters

value  String
The value.

Return Value

JsonValue
Null, if value was ; otherwise, a JsonValue that contains the specified value as a Number.

Remarks

  Caution

This method makes possible to create invalid JSON.

The Type property of the result will return Number even if value is not a valid number.

The AsLiteral property will return the specified value.

The AsNumber property of the result may return a less precise value, or even , though serializing to JSON by the ToString and WriteTo methods preserves the specified value.

See Also