tso-data-models
Advanced tools
Comparing version 1.0.130 to 1.0.131
@@ -23,5 +23,8 @@ "use strict"; | ||
var _a; | ||
console.log('Price ', this.price); | ||
if (this.price == "0") { | ||
console.log('Price1111 ', this.price); | ||
} | ||
else if (!this.price.includes('.')) { | ||
console.log('Price1122222211 ', this.price); | ||
var priceSplit = (_a = this.price) === null || _a === void 0 ? void 0 : _a.split('.'); | ||
@@ -32,7 +35,11 @@ var beforeDecimal = priceSplit[0]; | ||
//Remove Leading Zero | ||
console.log('beforeDecimal ', beforeDecimal); | ||
console.log('afterDecimal ', afterDecimal); | ||
if (beforeDecimal.startsWith('0')) { | ||
beforeDecimal = beforeDecimal.substr(1, beforeDecimal.length); | ||
console.log('beforeDecimal ', beforeDecimal); | ||
} | ||
// If too many digits truncate | ||
if ((afterDecimal === null || afterDecimal === void 0 ? void 0 : afterDecimal.length) > 5) { | ||
console.log('digitsdigits '); | ||
rightSide = afterDecimal === null || afterDecimal === void 0 ? void 0 : afterDecimal.substring(0, 5); | ||
@@ -42,2 +49,3 @@ // Number is too few DIgits | ||
else if (afterDecimal.length < 5) { | ||
console.log('fewfew '); | ||
var digitsToAdd = 5 - (afterDecimal === null || afterDecimal === void 0 ? void 0 : afterDecimal.length); | ||
@@ -44,0 +52,0 @@ rightSide = afterDecimal; |
{ | ||
"name": "tso-data-models", | ||
"version": "1.0.130", | ||
"version": "1.0.131", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -31,6 +31,8 @@ import { BigNumber, ethers } from "ethers"; | ||
formatPrice() { | ||
console.log('Price ', this.price) | ||
if (this.price == "0") { | ||
console.log('Price1111 ', this.price) | ||
} else if (!this.price.includes('.')) { | ||
console.log('Price1122222211 ', this.price) | ||
const priceSplit = this.price?.split('.'); | ||
@@ -41,7 +43,11 @@ let beforeDecimal = priceSplit[0]; | ||
//Remove Leading Zero | ||
console.log('beforeDecimal ', beforeDecimal) | ||
console.log('afterDecimal ', afterDecimal) | ||
if (beforeDecimal.startsWith('0')) { | ||
beforeDecimal = beforeDecimal.substr(1, beforeDecimal.length); | ||
console.log('beforeDecimal ', beforeDecimal) | ||
} | ||
// If too many digits truncate | ||
if (afterDecimal?.length > 5) { | ||
console.log('digitsdigits ') | ||
rightSide = afterDecimal?.substring(0, 5); | ||
@@ -51,2 +57,3 @@ | ||
} else if (afterDecimal.length < 5) { | ||
console.log('fewfew ') | ||
const digitsToAdd = 5 - afterDecimal?.length; | ||
@@ -53,0 +60,0 @@ rightSide = afterDecimal; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148920
2201