For license information check the LICENSE-file.
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.
<?= $form->field( $model, 'number' )
->widget( FormattedNumberWidget::classname(), [
"plugin" => [
"decimals" => 2
]
] ) ?>
- 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