thousandseparator and decimalSeparator for table decimal and numeric cell values

Questionsthousandseparator and decimalSeparator for table decimal and numeric cell values
toki asked 11 years ago

Hi,

is there any format option for thousandseparator and decimalSeparator for table decimal and numeric cell values.

Thank you.

3 Answers
Abu Ghufran answered 11 years ago

Try $col["formatter"] = "number"; with column config.

$col = array();
$col["title"] = "Total";
$col["name"] = "total";
$col["width"] = "50";
$col["editable"] = true;
$col["formatter"] = "number";

toki answered 11 years ago

Hi Abu,

$col["formatter"] = "number";

Yes, it works perfect in phpgrid for formatting numeric columns with thousandseparator and decimalseparator.

is it possible to use numeric formatter in add and edit dialogs or online editing when during adding and editing?

Thank you very much.

Regars…

Abu Ghufran answered 11 years ago

Yes, you can have it, but you might need to pass the posted data through some filter. For e.g. on_insert and on_update, and make it compatible with database.

// when 3rd argument true, fnuction will act as a filter for data.
$e["on_update"] = array("update_filter", null, true);

function update_filter(&$data)
{
$data["params"]["num"] = str_replace(",","",$data["params"]["num"]);
}

Your Answer

2 + 10 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?