cockroachdb / cockroachdb/apd

This function is converting any numeric value with more than 5 decimals into scientific notation

Open Beginner friendly
#151 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
805
Forks
48
PR merge metrics
No merged PRs in 30d

Description

https://github.com/cockroachdb/apd/blob/9c2ab8efc9ac66bf4bb79ab6bed4dcd0c709d1b9/decimal.go#L792

Ex: if input is 0.000001 or if a number has. more than 6 decimals. after decimal point, its being converted to scientific notation.

Ex : 0.000001 is converted to 1E-6

The fix will be instead of using "d.String()", it should be d.Text('f')

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in decimal.go at line 792 and inspect the formatting path that calls d.String(). Reproduce the issue with 0.000001 and a value with more than six decimal places, then verify that the output uses fixed-point formatting rather than scientific notation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.