mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Fixed json/toml float precision on write
This commit is contained in:
parent
209acd257c
commit
f47882194c
2 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <math.h>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
|
||||
#include "commons.h"
|
||||
|
|
@ -70,6 +71,8 @@ void stringify(Value* value,
|
|||
} else if (value->type == valtype::boolean) {
|
||||
ss << (value->value.boolean ? "true" : "false");
|
||||
} else if (value->type == valtype::number) {
|
||||
ss << std::fixed;
|
||||
ss << std::setprecision(15);
|
||||
ss << value->value.decimal;
|
||||
} else if (value->type == valtype::integer) {
|
||||
ss << value->value.integer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue