sergeyakovlev/int-format

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

Maintainers

Package info

github.com/sergeyakovlev/int-format-php

pkg:composer/sergeyakovlev/int-format

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2022-06-05 12:00 UTC

This package is auto-updated.

Last update: 2026-02-28 14:57:03 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"