Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-big-decimal

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-big-decimal - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

4

lib/big-decimal.d.ts

@@ -16,4 +16,4 @@ export declare class bigDecimal {

multiply(number: bigDecimal): bigDecimal;
static divide(number1: any, number2: any): string;
divide(number: bigDecimal): bigDecimal;
static divide(number1: any, number2: any, precision: any): string;
divide(number: bigDecimal, precision: any): bigDecimal;
static compareTo(number1: any, number2: any): 0 | 1 | -1;

@@ -20,0 +20,0 @@ compareTo(number: bigDecimal): 0 | 1 | -1;

@@ -130,9 +130,10 @@ "use strict";

};
bigDecimal.divide = function (number1, number2) {
bigDecimal.divide = function (number1, number2, precision) {
number1 = bigDecimal.validate(number1);
number2 = bigDecimal.validate(number2);
return divide_1.divide(number1, number2);
return divide_1.divide(number1, number2, precision);
};
bigDecimal.prototype.divide = function (number) {
return new bigDecimal(divide_1.divide(this.value, number.getValue()));
bigDecimal.prototype.divide = function (number, precision) {
console.log(precision);
return new bigDecimal(divide_1.divide(this.value, number.getValue(), precision));
};

@@ -139,0 +140,0 @@ bigDecimal.compareTo = function (number1, number2) {

@@ -72,4 +72,4 @@ "use strict";

}
return ((neg == 1) ? '-' : '') + round_1.roundOff(quotent, precission - 2);
return ((neg == 1) ? '-' : '') + add_1.trim(round_1.roundOff(quotent, precission - 2));
}
exports.divide = divide;
{
"name": "js-big-decimal",
"version": "1.1.2",
"version": "1.1.3",
"description": "Work with large numbers on the client side. Round them off to any required precission.",

@@ -11,3 +11,4 @@ "main": "lib/big-decimal",

"test-random": "node test/randomtest.js",
"compile": "./node_modules/.bin/tsc --watch"
"compile": "./node_modules/.bin/tsc --watch",
"toc": "doctoc --title **Contents** ./README.md"
},

@@ -40,3 +41,4 @@ "keywords": [

},
"false": {}
"false": {},
"dependencies": {}
}

@@ -10,2 +10,24 @@ # JS Big Decimal

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Contents**
- [Installation](#installation)
- [Usage](#usage)
- [Operations](#operations)
- [bigDecimal(number)](#bigdecimalnumber)
- [getValue()](#getvalue)
- [getPrettyValue(number, digits, separator)](#getprettyvaluenumber-digits-separator)
- [round(number, precision)](#roundnumber-precision)
- [compareTo(number1, number2)](#comparetonumber1-number2)
- [negate(number)](#negatenumber)
- [add(augend, addend)](#addaugend-addend)
- [subtract(minuend, subtrahend)](#subtractminuend-subtrahend)
- [multiply(multiplicand, multiplier)](#multiplymultiplicand-multiplier)
- [divide(dividend, divisor, precision)](#dividedividend-divisor-precision)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
---
## Installation

@@ -12,0 +34,0 @@ ```javascript

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc