| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 372e3ee commit 2f4577c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -195,8 +195,9 @@ function formatResult(data) { | |||
| 195 | 195 | conf += ' ' + key + '=' + JSON.stringify(data.conf[key]); | |
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | - const rate = Math.floor(data.rate) | ||
| 199 | - .toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); | ||
| 198 | + var rate = data.rate.toString().split('.'); | ||
| 199 | + rate[0] = rate[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); | ||
| 200 | + rate = (rate[1] ? rate.join('.') : rate[0]); | ||
| 200 | 201 | return `${data.name}${conf}: ${rate}`; | |
| 201 | 202 | } | |
| 202 | 203 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,8 +56,9 @@ if (format === 'csv') { | |||
| 56 | 56 | conf = conf.replace(/"/g, '""'); | |
| 57 | 57 | console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`); | |
| 58 | 58 | } else { | |
| 59 | - const rate = Math.floor(data.rate) | ||
| 60 | - .toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); | ||
| 59 | + var rate = data.rate.toString().split('.'); | ||
| 60 | + rate[0] = rate[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); | ||
| 61 | + rate = (rate[1] ? rate.join('.') : rate[0]); | ||
| 61 | 62 | console.log(`${data.name} ${conf}: ${rate}`); | |
| 62 | 63 | } | |
| 63 | 64 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments