Jacopo Mercolini 8d19c8b51e
feat: toBest(unit, unitList, offset) function (#3484)
* feat: toBest tests

* feat: toBest function initial

* fix: tests and function changes

* fix: dependencies

* new way to handle

* updated tests

* test updated

* tests fixed

* cleaned useless tests

* cleaned useless condition

* fix: missing comments

* fix: moved tests

* other fix and clean

* change test to work with npx mocha "path" -g "toBest"

* deleted check large and small value

* deleted precision test and fix options to bestprefix

* fix: moved toBest tests in correct file

* fix: math create

* fix: aligned files pre-mr

* fix: toBest docs test

* fix: lint issues

* fix: comments

* fix: added a helper function to simplify the test readability

* fix: unit.md and units.md docs updated

* fix: test on units.length

* added post process denormalize for tobest function to string returned value

* removed this.clone into format

* feat improve incompatible units test

* fix assign prefixes

* fixed examples

* changed order of params of assertUnit

* fixed comments and added toBest in knowProblems at doc.test

* refactor: update toBest functionality and adjust related tests for accuracy

* refactor: remove unnecessary offset initialization in prefix application

---------

Co-authored-by: Luca Quercetti <l.quercetti@wecodeyou.it>
Co-authored-by: Elia Alesiani <elia.alesiani@gmail.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
Co-authored-by: lucaQ <lucaquercetti@gmail.com>
Co-authored-by: EliaAlesiani <105418798+EliaAlesiani@users.noreply.github.com>
2025-07-09 19:16:47 +02:00
..
2021-12-29 09:38:57 +01:00
2016-03-04 16:34:52 +01:00