@suilend/sui-fe 0.2.72 → 0.2.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/format.js +3 -1
- package/package.json +1 -1
package/lib/format.js
CHANGED
|
@@ -185,9 +185,11 @@ const formatUsd = (value, options) => {
|
|
|
185
185
|
};
|
|
186
186
|
exports.formatUsd = formatUsd;
|
|
187
187
|
const formatPrice = (value) => {
|
|
188
|
+
if (value.eq(0))
|
|
189
|
+
return "$0.00";
|
|
188
190
|
return (0, exports.formatNumber)(value, {
|
|
189
191
|
prefix: "$",
|
|
190
|
-
dp: Math.max(0, -Math.floor(Math.log10(+value)) - 1) + 2, // 2sf
|
|
192
|
+
dp: Math.max(0, -Math.floor(Math.log10(+value)) - 1) + (value.lt(1) ? 4 : 2), // 4sf (if <1) or 2sf (if >=1)
|
|
191
193
|
roundingMode: bignumber_js_1.default.ROUND_HALF_UP,
|
|
192
194
|
exact: true,
|
|
193
195
|
useGrouping: true,
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe","version":"0.2.
|
|
1
|
+
{"name":"@suilend/sui-fe","version":"0.2.73","private":false,"description":"A collection of TypeScript frontend libraries","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./lib/api":"./lib/api.js","./lib/coinMetadata":"./lib/coinMetadata.js","./lib/coinType":"./lib/coinType.js","./lib/constants":"./lib/constants.js","./lib/format":"./lib/format.js","./lib":"./lib/index.js","./lib/indexedDB":"./lib/indexedDB.js","./lib/msafe":"./lib/msafe.js","./lib/track":"./lib/track.js","./lib/transactions":"./lib/transactions.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@pythnetwork/pyth-sui-js":"^2.1.0","bignumber.js":"^9.1.2","lodash":"^4.17.21","mixpanel-browser":"^2.56.0","next":"^15.0.3","p-limit":"3.1.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.8","@types/lodash":"^4.17.13","@types/mixpanel-browser":"^2.50.2","@types/node":"^22.9.0","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/sui":"1.28.2","date-fns":"^4.1.0"}}
|