We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getHumanAmount
1 parent a7e56c8 commit 23b0ee1Copy full SHA for 23b0ee1
2 files changed
sdk/package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "@metadaoproject/futarchy",
3
- "version": "0.3.0-alpha.0",
+ "version": "0.3.0-alpha.1",
4
"main": "dist/index.js",
5
"types": "dist/index.d.ts",
6
"files": [
sdk/src/utils/priceMath.ts
@@ -15,6 +15,10 @@ export class PriceMath {
15
return new BN(humanAmount * 10 ** decimals);
16
}
17
18
+ public static getHumanAmount(chainAmount: BN, decimals: number): number {
19
+ return chainAmount.toNumber() / 10 ** decimals
20
+ }
21
+
22
public static getHumanPrice(
23
ammPrice: BN,
24
baseDecimals: number,
0 commit comments