mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
fix offset
This commit is contained in:
parent
c018e8ee67
commit
8e7012a3f6
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@
|
||||
/yarn.lock
|
||||
|
||||
# production
|
||||
/build
|
||||
/dist
|
||||
/out
|
||||
|
||||
|
10
package.json
10
package.json
@ -10,10 +10,11 @@
|
||||
"types": "index.d.ts",
|
||||
"build": {
|
||||
"files": [
|
||||
"./dist/**/*",
|
||||
"./pages/**/*",
|
||||
"./node_modules/**/*"
|
||||
"./dist/**/*"
|
||||
],
|
||||
"directories": {
|
||||
"output": "./build"
|
||||
},
|
||||
"appId": "com.rstudio.comty",
|
||||
"asar": false
|
||||
},
|
||||
@ -23,12 +24,13 @@
|
||||
"debug": "node --inspect-brk ./node_modules/.bin/umi dev",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"electronDev": "concurrently \"electron .\" \"npm start\"",
|
||||
"electronDist": "electron-builder",
|
||||
"electron": "electron .",
|
||||
"umibuild": "umi build",
|
||||
"build": "npm run build:main && npm run build:renderer",
|
||||
"build:main": "roadhog build",
|
||||
"build:renderer": "umi build",
|
||||
"pack": "npm run build && npm run rebuild && build",
|
||||
"pack": "umi build && electron-builder -w nsis:x64",
|
||||
"pack:dir": "npm run build && npm run rebuild && build --dir",
|
||||
"pack:dirOnly": "build --dir"
|
||||
},
|
||||
|
@ -187,7 +187,7 @@ export function abbreviateCount(value) {
|
||||
let numberToSuffix = Math.floor(("" + value).length / 3)
|
||||
let divider = ""
|
||||
|
||||
for (const offset = 2; offset >= 1; offset--) {
|
||||
for (let offset = 2; offset >= 1; offset--) {
|
||||
divider = parseFloat((numberToSuffix != 0 ? (value / Math.pow(1000, numberToSuffix)) : value).toPrecision(offset))
|
||||
let firstDot = (divider + "").replace(/[^a-zA-Z 0-9]+/g, '')
|
||||
if (firstDot.length <= 2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user