---
title: "Sum Numbers action for ActionClip"
canonical_url: "https://actionclip.app/actions/sum-numbers"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-09-04.1"
catalog_published_at: "2026-09-04T10:30:00Z"
---

# Sum Numbers action for ActionClip

Total the numbers found in selected text.

## What it does

Total the numbers found in selected text. It runs locally and handles the selected text without contacting a service.

## Action details

| Field | Value |
| --- | --- |
| Category | Notes & Productivity |
| Action type | JavaScript |
| Default result | Copy the result |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Sum Numbers** — Selected text: Setup 1,250.50 + hosting 49.50 + tax 100 | 1400 |

## How to total the numbers found in selected text with ActionClip

1. Select the text you want to use.
2. Choose **Sum Numbers** from ActionClip.
3. Review the extracted result, then copy it where you need it.

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action script

````javascript
function run(selected_text) {
  var matches = selected_text.match(/[-+]?(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?/g) || [];
  if (matches.length === 0) return "No numbers found.";
  var precision = 0;
  var total = matches.reduce(function (sum, raw) {
    var decimal = raw.match(/\.(\d+)$/);
    if (decimal) precision = Math.max(precision, decimal[1].length);
    return sum + Number(raw.replace(/,/g, ""));
  }, 0);
  if (!Number.isFinite(total)) return "The selected numbers are too large to total safely.";
  return total.toFixed(precision).replace(/\.0+$/, "").replace(/(\.\d*?)0+$/, "$1");
}
````

## Links

- [HTML listing](https://actionclip.app/actions/sum-numbers)
- [Download action definition](https://actionclip.app/actions/sum-numbers.actionclip)
- [Browse Notes & Productivity actions](https://actionclip.app/marketplace#marketplace-notesProductivity)
- [All Marketplace listings](https://actionclip.app/marketplace)
