openframeworks / openframeworks/openFrameworks

ofToString() does not report all digits of precision

Open
#1,592 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

ofToString() should always return as many digits of precision as are available from the floating point value. it looks like right now, at least 2 or 3 digits of precision are being ignored. this was not a problem with sprintf(), but is a problem with stringstream. this problem first became clear with issue #1516 and a temporary fix was made to ofxXmlSettings, but a deeper fix to ofToString() still needs to be made.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of ofToString() and compare its stringstream formatting with the sprintf() behavior described in the issue. Inspect the temporary fix in ofxXmlSettings and issue #1516 for context; done means ofToString() preserves all precision available from the floating-point value without relying on that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.