Skip to content
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

Insert a comma when sent or messages in inbox > 1,000 #2199

Closed
RyckRichards opened this issue Mar 14, 2020 · 4 comments · Fixed by #2381
Closed

Insert a comma when sent or messages in inbox > 1,000 #2199

RyckRichards opened this issue Mar 14, 2020 · 4 comments · Fixed by #2381
Assignees
Labels
enhancement Issue that describes a problem that requires a change in the current functionalities of Tatoeba. good first issue Easy issue for new contributors to get started.

Comments

@RyckRichards
Copy link
Member

It occurs to me that on https://tatoeba.org/eng/private_messages/folder/Sent (and on the Inbox folder too) a comma is not inserted when it's > 1,000.

https://prnt.sc/rg12j8

image

The same happened with the advanced search too not long ago.

@jiru
Copy link
Member

jiru commented Mar 14, 2020

As always, thanks for reporting the problem, Ricardo. 🌜

To anyone who wants to solve this issue: check Andrea’s recent pull request #1979.

@jiru jiru added enhancement Issue that describes a problem that requires a change in the current functionalities of Tatoeba. good first issue Easy issue for new contributors to get started. labels Mar 14, 2020
@alanfgh
Copy link
Contributor

alanfgh commented Mar 14, 2020

Not only is It quite common for a thousands separator to be omitted for numbers less than 10,000, various manuals of style prefer it. From Wikipedia:

https://en.wikipedia.org/wiki/Decimal_separator#Exceptions_to_digit_grouping

Likewise, some manuals of style state that thousands separators should not be used in normal text for numbers from 1,000 to 9,999 inclusive where no decimal fractional part is shown (in other words, for four-digit whole numbers), whereas others use thousands separators, and others use both. For example, APA style stipulates a thousands separator for "most figures of 1,000 or more" except for page numbers, binary digits, temperatures, etc.

I myself prefer omission of a thousands separator in four-digit numbers.

@RyckRichards
Copy link
Member Author

Should this

212,40: $newMessages = TableRegistry::get('PrivateMessages')->numberOfUnreadMessages

become

212,40: $newMessages = TableRegistry::get('PrivateMessages')->this->Number->format($numberOfUnreadMessages) ? @AndiPersti

@AndiPersti
Copy link
Contributor

$this->Number->format() is a function which takes a number like so $formattedNumber = $this->Number->format(12345);. But in this case we don't write the number literally but it is stored in $newMessages so you need to put that variable inside the function instead of 123 and assign the result back to $newMessages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue that describes a problem that requires a change in the current functionalities of Tatoeba. good first issue Easy issue for new contributors to get started.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants