From 4a6a3d19af62708450dfcb8944d6ea72f2e1b4f2 Mon Sep 17 00:00:00 2001 From: Sunny Side Up Date: Mon, 18 Dec 2023 16:28:44 +1300 Subject: [PATCH] MINOR: adding SpelledOut method in DBInt --- src/ORM/FieldType/DBInt.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ORM/FieldType/DBInt.php b/src/ORM/FieldType/DBInt.php index 656a98ac3..c205f664c 100644 --- a/src/ORM/FieldType/DBInt.php +++ b/src/ORM/FieldType/DBInt.php @@ -64,7 +64,13 @@ class DBInt extends DBField { 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) { return NumericField::create($this->name, $title);