-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINOR: adding SpelledOut method in DBInt #11096
base: 5
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -64,7 +64,13 @@ public function Nice() | |||||||||||
{ | ||||||||||||
return sprintf('%d', $this->value); | ||||||||||||
} | ||||||||||||
|
||||||||||||
|
||||||||||||
public function SpelledOut() | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
People will expect a string, but This method should return an empty string in the event the |
||||||||||||
{ | ||||||||||||
$v = $this->prepValueForDB($this->value); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you calling |
||||||||||||
return (new NumberFormatter(i18n::get_locale(), NumberFormatter::SPELLOUT))->format($v); | ||||||||||||
Comment on lines
+70
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please don't use single-letter variables, nor wrap instantiation in quotes. |
||||||||||||
} | ||||||||||||
|
||||||||||||
public function scaffoldFormField($title = null, $params = null) | ||||||||||||
{ | ||||||||||||
return NumericField::create($this->name, $title); | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a phpdoc comment explaining what the method does.