JsonRoundingConverter
QuantConnect.Util.JsonRoundingConverter
Bases: JsonConverter
Helper JsonConverter that will round decimal and double types, to FRACTIONAL_DIGITS fractional digits
FRACTIONAL_DIGITS
FRACTIONAL_DIGITS: int = 4
The number of fractional digits to round to
can_read
can_read: bool
Will always return false. Gets a value indicating whether this Newtonsoft.Json.JsonConverter can read JSON.
can_convert
can_convert(object_type: Type) -> bool
Determines whether this instance can convert the specified object type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_type
|
Type
|
Type of the object. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if this instance can convert the specified object type. |
read_json
read_json(
reader: Any,
object_type: Type,
existing_value: Any,
serializer: Any,
) -> Object
Not implemented, will throw NotImplementedException
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reader
|
Any
|
The Newtonsoft.Json.JsonReader to read from. |
required |
object_type
|
Type
|
Type of the object. |
required |
existing_value
|
Any
|
The existing value of object being read. |
required |
serializer
|
Any
|
The calling serializer. |
required |
write_json
write_json(
writer: Any, value: Any, serializer: Any
) -> None
Writes the JSON representation of the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
writer
|
Any
|
The Newtonsoft.Json.JsonWriter to write to. |
required |
value
|
Any
|
The value. |
required |
serializer
|
Any
|
The calling serializer. |
required |