Skip to content

Adds toPrecisionWithoutTrailingZeros utility#9270

Merged
danjm merged 1 commit intodevelopfrom
toPrecisionWithoutTrailingZeros
Aug 19, 2020
Merged

Adds toPrecisionWithoutTrailingZeros utility#9270
danjm merged 1 commit intodevelopfrom
toPrecisionWithoutTrailingZeros

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented Aug 19, 2020

Adds a new utility function toPrecisionWithoutTrailingZeros

Given a number and specified precision, returns that number in base 10 with a maximum of precision significant digits, but without any trailing zeros after the decimal point To be used when wishing to display only as much digits to the user as necessary

@danjm danjm requested a review from a team as a code owner August 19, 2020 08:47
@danjm danjm requested a review from whymarrh August 19, 2020 08:47
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [09d11c4]
Page Load Metrics (489 ± 67 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32106522210
domContentLoaded26579748713967
load26679948913967
domInteractive26579748613967

Copy link
Copy Markdown
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit

@danjm danjm merged commit c0d7840 into develop Aug 19, 2020
@danjm danjm deleted the toPrecisionWithoutTrailingZeros branch August 19, 2020 14:04
Gudahtt added a commit that referenced this pull request Aug 19, 2020
* origin/develop: (137 commits)
  Use @metamask/eslint-config@3.1.0 (#9275)
  Standardize scss import practices (#9183)
  Update ESLint shared config to v3 (#9274)
  Add lock icon to default networks (#9269)
  Adds toPrecisionWithoutTrailingZeros utility (#9270)
  Hide gas estimate on non-main network (#9189)
  Move the mascot component to its own directory (#9272)
  Use @metamask/controllers@2.0.5 (#9266)
  Fix padding, alignment of actionable-message; add left aligned story
  Code cleanup and simplification for actionable-message component
  Adds actionable message component and stories
  Fix lint issues (#9265)
  Fix prefer-destructuring issues (#9263)
  colocate confirm-decrypt-message page styles (#9252)
  Tidy up Migrator tests (#9264)
  Adds pulse loader component (#9259)
  Fix import/order issues (#9239)
  Fix radix issues (#9247)
  New info tooltip component (#9180)
  Improve scss naming
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants