small fixes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { useState, useCallback } from "react";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { StepControls } from "./step-controls";
|
||||
import { parseStrictDecimal } from "@/lib/math/validation";
|
||||
|
||||
type RoundTarget = "whole" | "1dp" | "2dp" | "1sf" | "2sf" | "3sf";
|
||||
|
||||
@@ -384,9 +385,9 @@ export function RoundingExplorer() {
|
||||
function handleGo() {
|
||||
setError("");
|
||||
const trimmed = input.trim();
|
||||
const val = parseFloat(trimmed);
|
||||
if (isNaN(val)) {
|
||||
setError("Enter a valid number.");
|
||||
const val = parseStrictDecimal(trimmed);
|
||||
if (val === null) {
|
||||
setError("Enter a valid number (digits and decimal point only).");
|
||||
return;
|
||||
}
|
||||
if (val < 0) {
|
||||
|
||||
Reference in New Issue
Block a user