mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-27 16:26:16 +08:00
fix(usage): reduce price input step to 0.0001 for sub-cent precision (#2793)
The step was 0.01, preventing input of prices like DeepSeek's cache read cost ($0.0028/million tokens). Extract step value to a constant and apply to all four price fields. Closes #2503
This commit is contained in:
@@ -16,6 +16,8 @@ interface PricingEditModalProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const PRICE_INPUT_STEP = "0.0001";
|
||||
|
||||
export function PricingEditModal({
|
||||
open,
|
||||
model,
|
||||
@@ -151,7 +153,7 @@ export function PricingEditModal({
|
||||
<Input
|
||||
id="inputCost"
|
||||
type="number"
|
||||
step="0.01"
|
||||
step={PRICE_INPUT_STEP}
|
||||
min="0"
|
||||
value={formData.inputCost}
|
||||
onChange={(e) =>
|
||||
@@ -168,7 +170,7 @@ export function PricingEditModal({
|
||||
<Input
|
||||
id="outputCost"
|
||||
type="number"
|
||||
step="0.01"
|
||||
step={PRICE_INPUT_STEP}
|
||||
min="0"
|
||||
value={formData.outputCost}
|
||||
onChange={(e) =>
|
||||
@@ -188,7 +190,7 @@ export function PricingEditModal({
|
||||
<Input
|
||||
id="cacheReadCost"
|
||||
type="number"
|
||||
step="0.01"
|
||||
step={PRICE_INPUT_STEP}
|
||||
min="0"
|
||||
value={formData.cacheReadCost}
|
||||
onChange={(e) =>
|
||||
@@ -208,7 +210,7 @@ export function PricingEditModal({
|
||||
<Input
|
||||
id="cacheCreationCost"
|
||||
type="number"
|
||||
step="0.01"
|
||||
step={PRICE_INPUT_STEP}
|
||||
min="0"
|
||||
value={formData.cacheCreationCost}
|
||||
onChange={(e) =>
|
||||
|
||||
Reference in New Issue
Block a user