-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add counter UI for petition form
- Loading branch information
1 parent
1d96d9b
commit 09c7882
Showing
5 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,8 @@ | ||
// const targets = [ | ||
// 10, | ||
// 50, | ||
// 100, | ||
// 200, | ||
// 300, | ||
// 500, | ||
// 800, | ||
// 1000, | ||
// 1500, | ||
// 2000, | ||
// 3500, | ||
// 4000, | ||
// 5000, | ||
// 7000, | ||
// 10000, | ||
// 13000, | ||
// 15000, | ||
// 20000, | ||
// 35000, | ||
// 40000 | ||
// ] | ||
|
||
export const useGetNextTarget = (count: number) => { | ||
// let startCount = count | ||
let mag = Math.floor(Math.log10(count)) | ||
if (count === 10 ** mag) { | ||
mag += 1 | ||
if (count < 10) { | ||
return 10 | ||
} | ||
return Math.ceil(count / 10 ** mag) * 10 ** mag | ||
const target = count / 0.8 | ||
const mag = Math.floor(Math.log10(count)) | ||
return Math.ceil(target / 10 ** mag) * 10 ** mag | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters