toJSONString 时FLOAT类型小数点异常
Open
- Dominant language
- Swift
- Stars
- 4.3k
- Forks
- 677
- PR merge metrics
- No merged PRs in 30d
Description
struct data: HandyJSON {
var totalAmount: Float? = 41684.98
}
data.toJSONString() 之后变成了
{totalAmount: 41684.98046875}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reported data.toJSONString() entry point and reproduce the output using the Float value 41684.98. Trace the HandyJSON serialization path and add coverage for this case; done means the serialized JSON no longer exposes the unexpected extra fractional digits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100