Added new fields and forms
This commit is contained in:
parent
52d75b8029
commit
9db16a5edd
27 changed files with 832 additions and 34 deletions
26
src/CoreFields/MoneyField.php
Normal file
26
src/CoreFields/MoneyField.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace PhangoApp\PhaModels\CoreFields;
|
||||
|
||||
class MoneyField extends DoubleField{
|
||||
|
||||
|
||||
function show_formatted($value)
|
||||
{
|
||||
|
||||
return $this->currency_format($value);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static function currency_format($value, $symbol_currency='€')
|
||||
{
|
||||
|
||||
|
||||
return number_format($value, 2).' '.$symbol_currency;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue