{"id":15384675,"url":"https://github.com/stcruy/to-exponential","last_synced_at":"2025-04-15T19:42:54.911Z","repository":{"id":29350075,"uuid":"121435058","full_name":"stcruy/to-exponential","owner":"stcruy","description":"Converts any big/small/precise decimal number represented as String, to exponential notation.","archived":false,"fork":false,"pushed_at":"2022-02-11T12:22:51.000Z","size":68,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T00:24:32.557Z","etag":null,"topics":["decimal","exponential","notation","number","scientific","toexponential"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stcruy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-13T20:49:55.000Z","updated_at":"2024-06-14T07:41:18.000Z","dependencies_parsed_at":"2022-08-07T14:16:13.988Z","dependency_job_id":null,"html_url":"https://github.com/stcruy/to-exponential","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcruy%2Fto-exponential","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcruy%2Fto-exponential/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcruy%2Fto-exponential/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcruy%2Fto-exponential/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stcruy","download_url":"https://codeload.github.com/stcruy/to-exponential/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249140906,"owners_count":21219384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decimal","exponential","notation","number","scientific","toexponential"],"created_at":"2024-10-01T14:43:02.905Z","updated_at":"2025-04-15T19:42:54.889Z","avatar_url":"https://github.com/stcruy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## to-exponential\n\nConverts any arbitrarily big, small, or precise number represented as a String,\nto exponential notation. For regular numbers it works just like JavaScript's\n[`Number.toExponential()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential).\n\nThe returned String can be used as a unique identifier for the number's value.\n\n\n### Specification\n\nIt accepts any decimal number represented as a String.\n\n- It converts it to exponential notation without loss of precision.\n- It works for high precision numbers, also for those that do not fit in a\n  64-bit JavaScript Number variable.  \n  (They still have to fit in Strings, which have some maximum length).\n- It works for very large and very small numbers, also for those with an\n  exponent (`e...`) that does not fit in a 64-bit JS number.\n\nThe exponent always gets a sign (+ or -), consistent with the output of\n`Number.toExponential()`. So e.g. 5 becomes '5e+0' (not '5e0').\n\nReturns `false` if the String does not represent a valid decimal number.\n\n\n### Install\n\n```\nnpm install to-exponential\n```\n\n\n### Examples\n\n```\nconst toExponential = require('to-exponential');\n\nconsole.dir( toExponential('0.5') );  // =\u003e '5e-1'.\nconsole.dir( toExponential('5') );    // =\u003e '5e+0'.\nconsole.dir( toExponential('50') );   // =\u003e '5e+1'.\n\nconsole.dir( toExponential('10.5') );     // Outputs '1.05e+1'.\nconsole.dir( toExponential('0.105e2') );  // Outputs '1.05e+1' too.\n\nconsole.dir( toExponential(\n  '-12324.3434716349863831487632112E-561640934731461387461933142'\n) );\n// =\u003e '-1.23243434716349863831487632112e-561640934731461387461933138'.\n```\n\n### License\n\nThis project is licensed under the MIT license - see\n[LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcruy%2Fto-exponential","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstcruy%2Fto-exponential","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcruy%2Fto-exponential/lists"}