MINOR: adding SpelledOut method in DBInt

This commit is contained in:
Sunny Side Up 2023-12-18 16:28:44 +13:00 committed by GitHub
parent c96f37ea93
commit 4a6a3d19af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,12 @@ class DBInt extends DBField
return sprintf('%d', $this->value); return sprintf('%d', $this->value);
} }
public function SpelledOut()
{
$v = $this->prepValueForDB($this->value);
return (new NumberFormatter(i18n::get_locale(), NumberFormatter::SPELLOUT))->format($v);
}
public function scaffoldFormField($title = null, $params = null) public function scaffoldFormField($title = null, $params = null)
{ {
return NumericField::create($this->name, $title); return NumericField::create($this->name, $title);