Kantongku: guard target nominal 0 (edge case backup)
This commit is contained in:
@@ -176,7 +176,10 @@ export function SavingsScreen() {
|
||||
</View>
|
||||
) : (
|
||||
targets.map((target) => {
|
||||
const pct = Math.min(100, Math.round((total / target.targetAmount) * 100));
|
||||
const pct =
|
||||
target.targetAmount > 0
|
||||
? Math.min(100, Math.round((total / target.targetAmount) * 100))
|
||||
: 0;
|
||||
const remaining = Math.max(0, target.targetAmount - total);
|
||||
const now = new Date();
|
||||
const dayOfMonth = now.getDate();
|
||||
|
||||
Reference in New Issue
Block a user