You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, even without converting it in any way, powershell converts it to scientific notation. This seems to happen even with the ConvertTo-Json commandlets:
The ConvertFrom-Json commandlet seems to handle really large numbers by casting them to [System.Numerics.BigInteger]:
PS /home/gabriel>$testJson='{"num": 999999999999999999999999999999999}'
PS /home/gabriel>ConvertFrom-Json$testJson
num
---999999999999999999999999999999999
But this seems to break when converting back to Json:
That being said, I implemented the [BigInteger] handling in powershell-yaml as well for both converting from and to yaml. You can find a WiP branch here: #135
Hah. This change should help even on Windows Server 2016/Windows 10 running powershell 5.1, where the ConvertFrom-Json commandlet seems to convert to scientific notation:
The simple fact of converting from yaml and converting to yaml, it changes large numbers to a scientific notation:
Example:
Before Converting from ymal
After Converting to yaml
Expected:
Before Converting from ymal
After Converting to yaml
The text was updated successfully, but these errors were encountered: