sergeyakovlev/int-format

The function formats an integer with grouped thousands and optionally +/− signs

1.0.0 2022-06-05 12:00 UTC

This package is auto-updated.

Last update: 2025-04-28 13:01:32 UTC


README

The function formats an integer with grouped thousands and optionally +/− signs.

Install

Install via Composer:

$ composer require sergeyakovlev/int-format

Usage

use function SergeYakovlev\IntFormat\int_format;

$value = -1000000;

// Use cases are equivalent
$formatted_value = int_format($value);
$formatted_value = int_format($value, ' ', '', '−');
// $formatted_value = "−1 000 000"