Skip to content

Conversation

@rossbulat
Copy link
Contributor

@rossbulat rossbulat commented Oct 30, 2024

Changelog

Breaking changes: Bumps @w3ux/utils major version.

  • Removes bignumber.js as a w3ux dependency, and improves types support for the functions that were using BigNumber.
  • planckToUnit and unitToPlanck now allow BigInt | string | number as their input value.
  • planckToUnit returns a string, whereas unitToPlanck returns a BigInt. The prior returns string instead of number as there is no guarantee the resulting value will be a within the max supported value.
  • More test scenarios for the above functions.
  • minDecimalPlaces allow BigInt | string | number as its input value, and retains commas if present in input.
  • Covered more test scenarios for minDecimalPlaces.

The following utils have been removed as a result of BigNumber.js being deprecated:

  • greaterThanZero - syntax sugar over BigNumber.js syntax.
  • isNotZero - syntax sugar over BigNumber.js syntax.
  • evalUnits - unused in Polkadot Cloud apps.
  • stringToBigNumber - no longer required.
  • transformToBaseUnit - duplicate of planckToUnit.

Docs:

@rossbulat rossbulat marked this pull request as draft October 30, 2024 11:59
@rossbulat rossbulat changed the title feat(refactor): Removes bignumber.js as utils dependency. feat(refactor): Removes bignumber.js as utils dependency, remove obsolete utils Oct 31, 2024
@rossbulat rossbulat changed the title feat(refactor): Removes bignumber.js as utils dependency, remove obsolete utils feat(refactor): Removes bignumber.js as utils dependency, remove obsolete utils, enhance unit units Oct 31, 2024
@rossbulat rossbulat changed the title feat(refactor): Removes bignumber.js as utils dependency, remove obsolete utils, enhance unit units feat(refactor): Removes bignumber.js as utils dependency, remove obsolete utils, enhance unit utils Oct 31, 2024
@rossbulat rossbulat marked this pull request as ready for review October 31, 2024 12:54
@rossbulat rossbulat merged commit 3eb0ec7 into main Oct 31, 2024
@rossbulat rossbulat deleted the rb-draw-down-bnjs branch October 31, 2024 12:54
@rossbulat rossbulat mentioned this pull request Oct 29, 2024
@rossbulat rossbulat self-assigned this Nov 2, 2024
@rossbulat rossbulat mentioned this pull request Jun 5, 2025
@rossbulat rossbulat mentioned this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants