Skip to content
Snippets Groups Projects

Fixing precision issue when converting the u64 cents amount into f32.

Merged Nicolas80 requested to merge Nicolas80/gcli-v2s:fixing_balance_value_formatting into master

Now composing the displayed value with integer part and fractional part separately (keeping left padding of 0 for the decimal part for the amount of decimals required)

Potential issue with this version is that we don't use the locale to decide on the decimal separator (hardcoded to "." here)

Tested locally and resolve the issue with big amounts.

Example before:

gcli account balance                                                       
5Funkng8dL397H9ZEJ9sXDjFhStCqRYUj1a62ngcrEMy7ivn has 11233705000 ĞD

After:

gcli account balance 
5Funkng8dL397H9ZEJ9sXDjFhStCqRYUj1a62ngcrEMy7ivn has 11233705361.58 ĞD

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading