Precio desde margen objetivo
price-from-marginCalcula el precio necesario para un margen objetivo (precio = costo / (1 − m)) o un markup, y convierte entre ambos. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: calcular utilidad, margen bruto % (margin-markup). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Computes the selling price needed for a target gross margin % (price = cost / (1 − m)) or markup % (price = cost × (1 + k)), and converts between margin and markup. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: computing profit, gross margin % (margin-markup). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | Unit cost (number; required; min 0; max 1000000000000000). | |
| target | Yes | Target type (required; one of: margin, markup). | |
| percent | Yes | Target % (number; required; min 0; max 10000). | |
| decimals | No | Round price to decimals (integer; optional; default 2; min 0; max 6). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price | No | ||
| profit | No | ||
| margin_percent | No | ||
| markup_percent | No |