Skip to content

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

License

Notifications You must be signed in to change notification settings

sergeyakovlev/int-format-php

Repository files navigation

IntFormat

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"

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages