decimal.js
deno
decimal.js | deno | |
---|---|---|
22 | 448 | |
6,146 | 93,007 | |
- | 0.4% | |
0.0 | 9.9 | |
21 days ago | 6 days ago | |
JavaScript | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
decimal.js
- Floats Are Weird
-
Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?
ii) Third-Party Libraries There are various libraries like math.js, decimal.js, big.js that solve the problem. Each library functions according to its documentation. This approach is comparatively better.
-
Front-End Dilemmas: Tackling Precision Problems in JavaScript with Decimal.js
Desperate for a solution, I stumbled upon Decimal.js, a JavaScript library that provides arbitrary-precision decimal arithmetic. I was intrigued, so I decided to give it a try.
-
Rant - Javascript should be able to do simple f**king math by now
I too wish JS had a dedicated Decimal Type, but there is plenty of 3rd party libraries available like decimal.js
-
The Last Breaking Change | JSON Schema Blog
For your particular example though, if we keep in mind that the input data to be validated is JSON-serializable, only a string could possibly accommodate the precision expected of a decimal from among the JSON-serializable JS primitives. You could use one or more regex patterns to describe the allowable permutations. The resultant schema would be cross-platform since it doesn't use custom keywords - nice! You can also use unions if you want to say that integers, NaN, and Infinity are also allowed per the docs there.
-
Javascript precision with significant zeros
i've used Decimal.js to account for floating point issues in JS before. maybe this will help? I realize its not native and is a 3rd party lib - but its intent is to handle floating point issues and precision. That kinds sounds like the tree you're barking up right now. maybe it will help.
-
I'm too afraid to ask
In the example provided, the name of the library is literally Decimal.js: https://mikemcl.github.io/decimal.js/
-
[AskJS] Are there numeric textbox widgets with built-in support for big numbers like decimal.js?
I'm working on a project where users will enter numbers like 9,999,999,999.99999 (up to 15 digits, up to 5 of them decimal) and we are having a problem with Numbers losing precision beyond certain number of digits (a typical issue for IEEE Standard 754 Floating Point Numbers, the 0.1 + 0.2 problem). I've solved this problem in a few projects before with the help of decimal.js or bignumber,js . In those cases, we kept user-input as strings and used a few custom-made numeric textbox widgets to accommodate this. Unfortunately, those widgets were proprietary... Now I need one again, but can't find anything. Do they exist?
-
Show HN: I made a web-based notepad with a built in unit calculator
Looks good! I love the idea of the embedded calculator
I noticed that it doesn't handle remainder/modulo (%) equations:
"10 % 2" results in: "Left hand side of addition cannot be a percentage."
It does look like decimal.js can handle that: https://mikemcl.github.io/decimal.js/#mod
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
-
[AskJS] How do you deal with floats in production apps?
https://github.com/MikeMcl/decimal.js/ great library
deno
-
Bun - The One Tool for All Your JavaScript/Typescript Project's Needs?
NodeJS is the dominant Javascript server runtime environment for Javascript and Typescript (sort of) projects. But over the years, we have seen several attempts to build alternative runtime environments such as Deno and Bun, today’s subject, among others.
-
Bun 1.1
https://github.com/denoland/deno/issues is the ideal place -- we try to triage all incoming issues, the more specific the repro the easier it is to address but we will take a look at everything that comes in.
-
I have created a small anti-depression script
Install Node.js (or Bun, or Deno, or whatever JS runtime you prefer) if it's not there
-
How QUIC is displacing TCP for speed
QUIC is very exciting, after seeing what it can do for performance in Cloudflare network and Cloudflare workers, I can't wait to finally see it in Deno[0] 1.41.
[0] https://github.com/denoland/deno/pull/21942#issuecomment-192...
-
Unison Cloud
So as an end user it's kind of like https://deno.com/ where you buy into a runtime + comes prepacked with DBs (k/v stores), scheduling, and deploy stuff?
> by storing Unison code in a database, keyed by the hash of that code, we gain a perfect incremental compilation cache which is shared among all developers of a project. This is an absolutely WILD feature, but it's fantastic and hard to go back once you've experienced it. I am basically never waiting around for my code to compile - once code has been parsed and typechecked once, by anyone, it's not touched again until it's changed.
Interesting. Whats it like upgrading and managing dependencies in that code? I'd assume it gets more complex when it's not just the Union system but 3rd party plugins (stuff interacting with the OS or other libs).
-
Deno in 2023
~90MB+ at this stage and do now allow compression without erroring out. Deploying ala Golang is not feasible at that level but could well be down the line if this dev branch is picked up again!
The exe output grew from from ~50MB to plus ~90MB from 2021 to 2024: https://github.com/denoland/deno/discussions/9811 which mean Deno is worse than Node.js's pkg solution by a decent margin.
-
Mini site for recommending songs using Svelte & Deno
Behind the scenes is a simple Sveltekit-powered server function to fetch a Spotify client token then find a user's recommendation playlist and its track information. A Deno edge function to performs this data fetch and renders server-side Svelte.
-
Supercharge your app with user extensions using Deno JavaScript runtime
If your application is written in JavaScript, integrating it with JavaScript extensions is a no-brainer. However, Secutils.dev is entirely written in Rust. How would I even begin? Fortunately, I recently came across an excellent blog post series explaining how to implement your JavaScript runtime in a Rust application with Deno:
- Deno, the next-generation JavaScript runtime
- Oxlint – written in Rust – 50-100 Times Faster than ESLint
What are some alternatives?
mathjs - An extensive math library for JavaScript and Node.js
ASP.NET Core - ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
bigint-money - A Money class for high precision calculations using the ESnext bigint type.
typescript-language-server - TypeScript & JavaScript Language Server
0.30000000000000004 - Floating Point Math Examples
pnpm - Fast, disk space efficient package manager
liveCalc - having fun with arithmetic
esbuild - An extremely fast bundler for the web
Brick\Math - Arbitrary-precision arithmetic library for PHP
bun - Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
eslint-plugin-big-number-rules - Enforce (or automatically fix) finance-safe calculations using BigNumber or similar libraries.
Koa - Expressive middleware for node.js using ES2017 async functions