
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@odata2ts/converter-decimal
Advanced tools
decimal.js based odata2ts compatible converter for OData's `Edm.Int64` and `Edm.Decimal` types
decimal.js based odata2ts
compatible converter for OData's Edm.Int64 and Edm.Decimal types.
From the comparison:
decimal.js was orginally developed through adding support for non-integer powers to bignumber.js, but I decided to release it as a separate library. The main difference between them is that precision is specified in terms of significant digits in decimal.js instead of decimal places, and all calculations are rounded to that precision (similar to Python's decimal module) rather than just those involving division.
bignumber.js is perhaps more suitable for financial applications because the user doesn't need to worry about losing precision unless an operation involving division is used.
decimal.js may be better for more scientific applications as it can handle very small or large values more efficiently. For example, it does not have the limitation of bignumber.js that when adding a value with a small exponent to one with a large exponent, bignumber.js will attempt to perform the operation to full precision, which may make the time taken for the operation unviable.
As mentioned above, decimal.js also supports non-integer powers and adds the trigonometric functions and exp, ln, and log methods. These additions make decimal.js significantly larger than bignumber.js.
| OData Type | Result Type | Converter Id | Description |
|---|---|---|---|
Edm.Int64 | Decimal | decimalConverter | see Decimal documentation |
Edm.Decimal | Decimal | decimalConverter | see Decimal documentation |
As usual:
npm install --save @odata2ts/converter-decimal
Note, that this converter expects, that you install decimal.js by yourself:
npm install --save decimal.js
Decimal Converter Documentation
Main Documentation of odata2ts: https://odata2ts.github.io/
This project is open to feature requests, suggestions, bug reports, usage questions etc. via GitHub issues.
Contributions and feedback are encouraged and always welcome.
See the contribution guidelines for further information.
This project has been created and is maintained in the following spirit:
MIT - see License.
FAQs
decimal.js based odata2ts compatible converter for OData's `Edm.Int64` and `Edm.Decimal` types
We found that @odata2ts/converter-decimal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.