Skip to content

Loss of float precision when using save as on a text resource or scene #99103

@nikitalita

Description

@nikitalita

Tested versions

current master @ ec6a1c0

System information

macOS 14.5.0, M2 Pro, Vulkan

Issue description

Re-saving a text scene/resource as another text scene/resource with float properties results in a loss of precision when the float has a precision of >6.

This is an issue with String::num_scientific;

The default for printf('%lg') is 6 precision.

Steps to reproduce

Open the MRP an editor
Re-save main.tscn as main-2.tscn
Observe that MobTimer.wait_time has reduced in precision from 0.570710678118 to 0.570711

Minimal reproduction project (MRP)

dodge_the_creeps.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions