eos-common
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -44,3 +44,3 @@ "use strict"; | ||
const precision = (amount_str.split(".")[1] || []).length; | ||
this.amount = utils_1.number_to_bigint(Number(amount_str) * Math.pow(10, precision)); | ||
this.amount = utils_1.number_to_bigint(amount_str); | ||
this.symbol = new symbol_1.Sym(symbol_str, precision); | ||
@@ -47,0 +47,0 @@ } |
@@ -8,3 +8,3 @@ import { Sym } from "./symbol"; | ||
export declare function getType(obj: any): string; | ||
export declare function number_to_bigint(num: number): BigInteger; | ||
export declare function number_to_bigint(num: number | string): BigInteger; | ||
export declare function isNull(value: any): boolean; | ||
@@ -11,0 +11,0 @@ export declare function getAmount(obj: any): BigInteger; |
@@ -16,2 +16,4 @@ "use strict"; | ||
function number_to_bigint(num) { | ||
if (typeof num == "string") | ||
return big_integer_1.default(num.replace(".", "")); | ||
return big_integer_1.default(Math.floor(Number(num.toFixed(0)))); | ||
@@ -36,3 +38,3 @@ } | ||
if (typeof obj == "string") | ||
return number_to_bigint(Number(obj)); | ||
return number_to_bigint(obj); | ||
throw new Error("invalid getAmount param"); | ||
@@ -39,0 +41,0 @@ } |
{ | ||
"name": "eos-common", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "EOSIO Smart Contract common library used for Typescript", | ||
@@ -12,3 +12,5 @@ "main": "dist/index.js", | ||
"contributors": [ | ||
"John Williamson <@Velua>" | ||
"John Williamson <@Velua>", | ||
"Yaro <@YaroShkvorets>", | ||
"Artem <@Avm07>" | ||
], | ||
@@ -30,3 +32,3 @@ "license": "MIT", | ||
"@types/jest": "*", | ||
"@typescript-eslint/eslint-plugin": "^2.20.0", | ||
"@typescript-eslint/eslint-plugin": "*", | ||
"@typescript-eslint/parser": "*", | ||
@@ -41,4 +43,4 @@ "documentation": "*", | ||
"dependencies": { | ||
"big-integer": "^1.6.48" | ||
"big-integer": "1.x" | ||
} | ||
} |
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
96416
2192
Updatedbig-integer@1.x