Questions tagged [big.js]

Tag for questions about big.js - a JavaScript library for arbitrary-precision decimal arithmetic

big.js is a JavaScript library for arbitrary-precision decimal arithmetic. Similar to bignumber.js and decimal.js

You can read more about big.js in its introductory documentation on GitHub.

7 questions
4
votes
0 answers

Big.js Typescript Error: Cannot access ambient const enums when the '--isolatedModules' flag is provided.ts(2748)

I am using big.js in a Typescript react app and the following code const toFixedRounding = { [Rounding.ROUND_DOWN]: RoundingMode.RoundDown, [Rounding.ROUND_HALF_UP]: RoundingMode.RoundHalfUp, [Rounding.ROUND_UP]:…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
2
votes
0 answers

'Property doesn't exist' error with imported module in Svelte

I want to use big.js or decimal.js to perform accurate calculations of decimal numbers in my basic Svelte app. To test it, I have imported the module in my App.svelte file: import Decimal from "../node_modules/decimal.js/decimal.mjs"; import Big…
Sidders
  • 124
  • 10
2
votes
1 answer

Angular application gets large numbers from the backend and they are displayed badly in an html table

My application is built in angular 7 and has a service that requests data from the WebApi that has EntityFramewrok to return the information. The problem is that the numeric fields that have more than 18 digits are arriving incorrectly (for example…
Christian
  • 23
  • 2
0
votes
1 answer

big.js node module not working with webpack

I'm trying to use webpack to compile (typescript files) and bundle up my source code. Here is my current webpack.config.js file: const path = require('path') module.exports = { devtool: 'eval-source-map', entry: './src/main.ts', module: { …
0
votes
0 answers

Unable to access an installed npm package in a laravel view

I have installed big.js but still cannot access it from script tags within the different views in my application. I keep getting the following error: Uncaught ReferenceError: Big is not defined …
0
votes
1 answer

Node function return data type using big.js

I am new to node and trying to create a class that has three properties of which one is calculated. const Big = require("big.js"); // https://www.npmjs.com/package/big-js class Trade{ constructor(name, buy, sell) { this.name = name; …
Dercni
  • 1,216
  • 3
  • 18
  • 38
0
votes
6 answers

find cube root using limited math operators

I need to write a function which tells me if a number is a perfect cube. If it is I want the cube root returned else false as follows: cubeRoot(1) // 1 cubeRoot(8) // 2 cubeRoot(9) // false cubeRoot(27) // 3 cubeRoot(28) // false It must…
danday74
  • 52,471
  • 49
  • 232
  • 283