AlphaWallet / AlphaWallet/alpha-wallet-ios

Replace occurrences of String(format: "%.5f"... with appropriate NumberFormatter

Open
#3,816 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
631
Forks
384
PR merge metrics
No merged PRs in 30d

Description

Use an existing `NumberFormatter` or create a new `NumberFormatter` in `Formatters.swift` so that the rounding and precision is the same throughout the app. Rounding is implementation-defined as seen below (the fprintf [specification](https://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html))

"The double argument shall be converted to decimal notation in the style "[-]ddd.ddd", where the number of digits after the radix character is equal to the precision specification. If the precision is missing, it shall be taken as 6; if the precision is explicitly zero and no '#' flag is present, no radix character shall appear. If a radix character appears, at least one digit appears before it. _The low-order digit shall be rounded in an implementation-defined manner._"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.