mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-22 23:21:52 -05:00
* Round velocity to thousandths place, fix bug in round function * Prettier application
This commit is contained in:
parent
25391899b4
commit
40e56d2b53
|
|
@ -1040,7 +1040,7 @@ const SUB_WEAPON_STATS = [
|
|||
{
|
||||
analyzedBuildKey: "subVelocity",
|
||||
abilityValuesKey: "SpawnSpeedZSpecUp",
|
||||
type: "NO_CHANGE",
|
||||
type: "SUB_VELOCITY",
|
||||
},
|
||||
{
|
||||
analyzedBuildKey: "subFirstPhaseDuration",
|
||||
|
|
@ -1092,6 +1092,8 @@ export function subStats(
|
|||
switch (type) {
|
||||
case "NO_CHANGE":
|
||||
return roundToNDecimalPlaces(effect);
|
||||
case "SUB_VELOCITY":
|
||||
return roundToNDecimalPlaces(effect, 3);
|
||||
case "HP":
|
||||
return roundToNDecimalPlaces(hpDivided(effect), 1);
|
||||
case "TIME":
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export function roundToNDecimalPlaces(num: number, n = 2) {
|
||||
return Number((Math.round(num * 100) / 100).toFixed(n));
|
||||
return Number((Math.round(num * 10 ** n) / 10 ** n).toFixed(n));
|
||||
}
|
||||
|
||||
export function cutToNDecimalPlaces(num: number, n = 2) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user