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

biggystring

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biggystring - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

lib/test/test.d.ts

8

lib/src/index.js

@@ -309,3 +309,3 @@ "use strict";

function precisionAdjust(type, x1, precision = 0) {
var _a;
var _a, _b;
validate(x1);

@@ -341,3 +341,7 @@ let negative = false;

const addValue = '1' + zeroString;
outCombined = add(outCombined, addValue);
// Leading zeros get removed after an `add`. Save the number of leading zeros
// and add them back
const leadingZeros = ((_b = outCombined.match(/^0+/)) !== null && _b !== void 0 ? _b : [''])[0].length;
const leadingZerosString = new Array(leadingZeros).join('0');
outCombined = leadingZerosString + add(outCombined, addValue);
}

@@ -344,0 +348,0 @@ const newDecimalPos = decimalPos + (outCombined.length - combined.length);

@@ -438,2 +438,11 @@ "use strict";

});
it('-0.006234 -5 => -0.00623', () => {
chai_1.assert.equal(index_1.round('-0.006234', -5), '-0.00623');
});
it('-0.006237 -5 => -0.00624', () => {
chai_1.assert.equal(index_1.round('-0.006237', -5), '-0.00624');
});
it('0.006237 -5 => 0.00624', () => {
chai_1.assert.equal(index_1.round('0.006237', -5), '0.00624');
});
it('-0.1234 0 => 0', () => {

@@ -493,4 +502,10 @@ chai_1.assert.equal(index_1.round('-0.1234', 0), '0');

});
it('0.000058196685058537 -8 => 0.0000582', () => {
chai_1.assert.equal(index_1.round('0.000058196685058537', -8), '0.0000582');
});
});
describe('ceil', () => {
it('-0.006237 -5 => -0.00624', () => {
chai_1.assert.equal(index_1.ceil('-0.006237', -5), '-0.00624');
});
it('-12345.678 8 => -100000000', () => {

@@ -534,2 +549,5 @@ chai_1.assert.equal(index_1.ceil('-12345.678', 8), '-100000000');

describe('floor', () => {
it('-0.006237 -5 => -0.00623', () => {
chai_1.assert.equal(index_1.floor('-0.006237', -5), '-0.00623');
});
it('-12345.678 8 => 0', () => {

@@ -536,0 +554,0 @@ chai_1.assert.equal(index_1.floor('-12345.678', 8), '0');

{
"name": "biggystring",
"version": "4.1.1",
"version": "4.1.2",
"description": "Full floating point big number library using regular Javascript string",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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