diff --git a/src/item/type-specific-helpers/spell.ts b/src/item/type-specific-helpers/spell.ts index e8820b43..5af27f20 100644 --- a/src/item/type-specific-helpers/spell.ts +++ b/src/item/type-specific-helpers/spell.ts @@ -19,21 +19,22 @@ export function calculateSpellPrice(data: DS4SpellDataSourceData): number | null function calculateSpellPriceFactor(temporalData: UnitData): number { let days: number; if (Number.isNumeric(temporalData.value)) { + const value = Number.fromString(temporalData.value); switch (temporalData.unit) { case "days": { - days = temporalData.value; + days = value; break; } case "hours": { - days = temporalData.value / hoursPerDay; + days = value / hoursPerDay; break; } case "minutes": { - days = temporalData.value / (hoursPerDay * minutesPerHour); + days = value / (hoursPerDay * minutesPerHour); break; } case "rounds": { - days = (temporalData.value * secondsPerRound) / (hoursPerDay * minutesPerHour * secondsPerMinute); + days = (value * secondsPerRound) / (hoursPerDay * minutesPerHour * secondsPerMinute); break; } }