Re: How can I stop D from dropping decimals in strings

2021-02-02 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 2 February 2021 at 23:10:50 UTC, Steven Schveighoffer wrote: On 2/2/21 5:27 PM, Tim wrote: Hi all, I have to serialize an array like [0.0, 0.0, 0.0] to a Json object. During this process, the serializer creates a string of the array, but it creates "[0, 0, 0]", dropping the

Re: How can I stop D from dropping decimals in strings

2021-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/2/21 5:27 PM, Tim wrote: Hi all, I have to serialize an array like [0.0, 0.0, 0.0] to a Json object. During this process, the serializer creates a string of the array, but it creates "[0, 0, 0]", dropping the decimal. How can I stop this? It totally depends on the library. As Adam

Re: How can I stop D from dropping decimals in strings

2021-02-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 2 February 2021 at 22:27:53 UTC, Tim wrote: I have to serialize an array like [0.0, 0.0, 0.0] to a Json object. During this process, the serializer creates a string of the array, but it creates "[0, 0, 0]", dropping the decimal. How can I stop this? This depends on the library

How can I stop D from dropping decimals in strings

2021-02-02 Thread Tim via Digitalmars-d-learn
Hi all, I have to serialize an array like [0.0, 0.0, 0.0] to a Json object. During this process, the serializer creates a string of the array, but it creates "[0, 0, 0]", dropping the decimal. How can I stop this?