Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Format numbers for better readability #60

Closed
Tracked by #3921
f0i opened this issue Oct 3, 2022 · 0 comments
Closed
Tracked by #3921

Format numbers for better readability #60

f0i opened this issue Oct 3, 2022 · 0 comments

Comments

@f0i
Copy link
Contributor

f0i commented Oct 3, 2022

Enforce the [style guide recommendation](https://internetcomputer.org/docs/current/developer-docs/build/cdks/motoko-dfinity/style/#miscellaneous] for numbers:

Group by 3 digits in decimal numbers and by 4 in hexadecimal notation.

In addition, add leading zeros in hex notation to be 2 digits or a multiple of 4 digits.

Examples:

  • 1000000 would be formatted as 1_000_000
  • 0x2 would be formatted as 0x02
  • 0x123456 would be formatted as 0x0012_3456
  • 12_34_56 would be formatted as 123_456
  • 0.123456 would be formatted as 0.123_456
@crusso crusso mentioned this issue Apr 4, 2023
79 tasks
@rvanasa rvanasa closed this as completed Dec 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants