---
title: "Count significant figures in a number and optionally round to N significant figures. Accepts the number as a string to preserve trailing zeros (e.g. '1.200' has 4 sig figs). Applies standard sig fig rules: leading zeros do not count, trailing zeros after a decimal point count, trailing zeros before a decimal point are treated as significant. Also returns the number in scientific notation. Essential for laboratory measurements, error analysis, and maintaining proper precision in chained calculations."
method: POST
path: "/api/sig_figs"
tags: ["general"]
---

# Count significant figures in a number and optionally round to N significant figures. Accepts the number as a string to preserve trailing zeros (e.g. '1.200' has 4 sig figs). Applies standard sig fig rules: leading zeros do not count, trailing zeros after a decimal point count, trailing zeros before a decimal point are treated as significant. Also returns the number in scientific notation. Essential for laboratory measurements, error analysis, and maintaining proper precision in chained calculations.

`POST /api/sig_figs`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/sig_figs`
- Auth: none declared

## Request body

- object
  - `number_str` string, required: The number as a string to preserve trailing zeros (e.g. '1.200')
  - `round_to_n` number: Optionally round the number to this many significant figures

## Response `200`

Computed result for sig_figs

- object
  - `result` object, required
    - `sig_figs_count` number, required: Number of significant figures in the input
    - `rounded_to_n` string, nullable, required: The number rounded to N significant figures (null if N not provided)
    - `scientific_notation` string, required: The number expressed in scientific notation
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
