Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in to_string_decimal #2114

Merged
merged 1 commit into from
Apr 20, 2024
Merged

Fix bug in to_string_decimal #2114

merged 1 commit into from
Apr 20, 2024

Conversation

htotoo
Copy link
Member

@htotoo htotoo commented Apr 20, 2024

There is a bug in to_string_decimal, when we use too high precision (>9) the result will be invalid, since we will cast the double fraction value to uint32_t.
That can hold 9 digits safely. So limiting precision to 9.

@htotoo htotoo requested a review from jLynx April 20, 2024 11:15
@htotoo htotoo changed the title Fix bug Fix bug in to_string_decimal Apr 20, 2024
@htotoo htotoo merged commit e735956 into portapack-mayhem:next Apr 20, 2024
3 checks passed
@htotoo htotoo deleted the strdec branch April 20, 2024 12:27
htotoo added a commit to htotoo/portapack-mayhem that referenced this pull request Apr 21, 2024
htotoo added a commit that referenced this pull request Apr 24, 2024
* BMP initial

* Add vscode debug configuration as a template (#2109)

* usb serial debug interface & usb serial async msg (#2111)

* add serial_debug

* not use OSS

* add path print

* add string print and vec

* clean up

* clean up

* format

* add an async blocking bool

* add an async blocking bool - comment

* protect the unexpected tx

* naming

* remove demo code

* fix bottom-up format, and add auto extend, ..

* bmp write

* Minor additions

* Minor

* overwrite on create

* Tmp

* Basic view - WIP

* debug

* add literal str print in asyncmsg (#2113)

* add literal str print in asyncmsg

* remove debug things

* accept suggestion per gull

* fix documentary

* Fix bug (#2114)

* Disable Back button during Touch Calibration (#2115)

* ADS1100 (#2116)

* WIP

* WIP

* WIP

* Corrected name

* WIP

* WIP

* WIP

* WIP

* Added new calc

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Added debug serial lines

* WIP

* Fixed issue

* Fixed calculation issue

* Added voltage to performance DFU menu

* Added padding function and added voltage to perf menu

* Clean up

* Refactor

* Fixed linting

* Hides voltage if PP does not conatin IC

* WIP showing battery %

* made the percentage a int

* Added % to header

* Removed test UI

* Removed comment

* Added fix for precision too large

* Added fix for precision too large

* Linting

* widget

* auto zoom

* remove debug

* move in screen

* fix math

* remove test code

* fix

* fix compiler warning

* BMP File viewer

* Full screen

* bg instead of noice

* add comment

* Handle some not supported formats.

---------

Co-authored-by: E.T <[email protected]>
Co-authored-by: sommermorgentraum <[email protected]>
Co-authored-by: Mark Thompson <[email protected]>
Co-authored-by: jLynx <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants