alibaba / alibaba/HandyJSON

toJSONString 时FLOAT类型小数点异常

Open
#388 0 comments 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.