Skip to content

money_float

A policy diagnostic from deedglass policy lint and the policy routes.

Severity: error

An amount of money is a YAML number. YAML numbers are floating point, and 0.1 + 0.2 is not 0.3 in floating point, so money is always a string with a currency.

deedglass: policy/v1
name: refunds
defaults:
decision: deny
reason: No rule allows this action.
budgets:
- id: refunds-per-day
match: { tool: stripe.create_refund }
per: org
window: day
max_spend: 500.00
✕ policy.yaml:11:16 · money_float
max_spend: 500.00 is a YAML number.
hint: Write money as a string, like "50.00 usd", so no precision is lost.

Fix:

max_spend: "500.00 usd"