{"id":"decimal-multiply","version":"1.0.0","description":"Multiply two decimal strings exactly, optionally rounding the product once to a fixed scale with a chosen mode.","supported_operations":["multiply two decimals exactly","exact decimal multiplication","price times quantity exact","multiply money without floating point error","multiply decimals and round to 2 places","unit price multiplied by quantity","decimal product with rounding mode","line total exact multiply"],"unsupported_operations":["floating point or scientific notation input","multiplying more than two numbers or evaluating a formula","percentage calculations","currency conversion with exchange rates"],"semantics":["Decimal strings match ^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$: no plus sign, exponent, leading zeros, leading or trailing point, whitespace or separators. A JSON number where a decimal string is required is invalid_input (wrong type).","A decimal string longer than 62 UTF-16 code units -> limit_exceeded, checked before the grammar. Otherwise a grammar failure, more than 60 digits in total, or more than 40 fraction digits -> invalid_input.","Zero has no sign: \"-0\", \"-0.00\" and any all-zero value are zero and are emitted as \"0\" (canonical) or \"0.00\" (fixed scale), never \"-0\".","Both a and b are multiplied as exact rationals; the product is exact (at most 120 digits, so no result-size limit can trigger).","scale and rounding must appear together or not at all; exactly one of them present -> invalid_input. scale is a JSON integer 0..40 and rounding one of the ten mode names; anything else -> invalid_input.","With no scale and no rounding the value is the exact canonical product and exact is true (1.20 * 3 -> \"3.6\"; use scale 2 to obtain \"3.60\").","With scale and rounding the exact product is rounded once to scale fraction digits. exact is true iff that rounding changed nothing.","Rounding modes act on the exact rational result and are: half_even (ties to the even neighbour), half_up (ties away from zero), half_down (ties toward zero), half_ceiling (ties toward +infinity), half_floor (ties toward -infinity), up (away from zero), down (toward zero), ceiling (toward +infinity), floor (toward -infinity), unnecessary (any inexact result -> not_computable with details.reason \"rounding_necessary\").","A result rounded to scale s is written with exactly s fraction digits (no fraction and no point when s is 0); a result with no scale is canonical: trailing fraction zeros are stripped and an integer has no point.","Validation order (each vector carries a single fault): input not an object; unknown field; missing required field; field types, ranges and decimal-string limits; scale/rounding pairing; then domain errors (not_computable) last.","rounding \"unnecessary\" with an inexact product -> not_computable with details.reason \"rounding_necessary\"."],"limits":{"max_decimal_chars":62,"max_decimal_digits":60,"max_fraction_digits":40,"max_scale":40},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["a","b"],"properties":{"a":{"type":"string","minLength":1,"maxLength":62,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"First factor as a decimal string."},"b":{"type":"string","minLength":1,"maxLength":62,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Second factor as a decimal string."},"scale":{"type":"integer","minimum":0,"maximum":40,"description":"Fraction digits of the result. Must be given together with rounding; omit both for the exact product."},"rounding":{"type":"string","enum":["half_even","half_up","half_down","half_ceiling","half_floor","up","down","ceiling","floor","unnecessary"],"description":"Rounding mode applied to the exact product. Must be given together with scale."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["value","exact"],"properties":{"value":{"type":"string","minLength":1,"maxLength":200,"description":"The product: canonical when no scale was given, otherwise fixed at scale fraction digits."},"exact":{"type":"boolean","description":"true when the reported value equals the exact product (no digits were changed by rounding)."}}},"examples":[{"input":{"a":"19.99","b":"3"},"output":{"value":"59.97","exact":true}},{"input":{"a":"0.07","b":"1234.5","scale":2,"rounding":"half_up"},"output":{"value":"86.42","exact":false}}],"execute_url":"/v1/tools/decimal-multiply/versions/1.0.0/execute"}