https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


Adding a thousands separator

  • djb
  • djb's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 months ago #1490

Hi,

Can you tell me the code to insert a thousands separator into the number of records that appears at the top of each table please?

I have looked at gridview.php but cannot display the number in the format I would like. For example 12,345 rather than 12345.

I think the code to change is:

if($this->_config->nrRecords){
$title.="(".$this->rows." Records)  ";

Can you help please?

Thank you
David

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #1513

Hi, I suggest that you rather use a database view.

Take a look at the following topic

toolsjx.com/index.php?option=com_kunena&...id=1259&catid=2#1259

Regards,
Tomaž

Please Log in or Create an account to join the conversation.

  • djb
  • djb's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 3 months ago #1517

Tomaž,

Thank you for your reply.

I don't think I made myself very clear. It is not data in a table that I wish to format. It is the number of records in the table that appears above the table that I wish to change.

My table looks like this:

Search: All fields xxxxxxxx Records per page: 10
(224607 Records)
Field 1 Field 2 Field 3 ...


I would like it to look like this:

Search: All fields xxxxxxxx Records per page: 10
(224,607 Records)
Field 1 Field 2 Field 3 ...

Does that make more sense?

Kind regards
David

Last edit: 12 years 3 months ago by djb.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #1525

I am sorry. I was reading too fast. I suggest that you take a look at php number_format() function.

So it would be something like

$title.="(".number_format($this->rows)." Records)  ";
depending on your Tools JX version.

Regards,
Tomaž

Please Log in or Create an account to join the conversation.

  • djb
  • djb's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 2 months ago #1552

That worked perfectly. Many thanks!

Please Log in or Create an account to join the conversation.

  • djb
  • djb's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
11 years 10 months ago #1847

Tomaž,

Since upgrading to 1.5.12 yesterday, I have noticed that the thousands separator is now longer displaying as it did.

I thought the file components/com_grid/views/GridView.php must have been overwritten during the three upgrades but this is not the case and the line, $title.="(".number_format($this->rows)." Records)  " is still present.

Can you tell me why this is not now displaying please?

Is it linked to my other query about why the search box also no longer displays?

With thanks
David

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.171 seconds

Contact Us

Contact us on Discord

Contact us on Facebook