grenhaz/yii2-formattednumber

Yii2 Formatter number input

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

1.0.0 2018-03-19 16:53 UTC

This package is not auto-updated.

Last update: 2024-09-29 04:36:54 UTC


README

For license information check the LICENSE-file.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist grenhaz/yii2-formattednumber

or add

"grenhaz/yii2-formattednumber": "~1.0.0"

to the require section of your composer.json.

Basic Usage

<?= $form->field( $model, 'number' )
        ->widget( FormattedNumberWidget::classname(), [
            "plugin" => [
                "decimals" => 2
            ]
        ] ) ?>

Example

Example

Configuration

  • decimals - Number of decimals to show. default: 2
  • thousandSeparator - Thousand separator character. default: (empty)
  • decimalSeparator - Decimal separator character. default: .
  • emptyAllowed - Allow empty values. default: true
  • forceDecimals - Force to show or not all decimals. default: true
  • align - Text alignment. default: right