Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Seperator in number, like "25.000"

Quote Reply
Seperator in number, like "25.000"
Hi,
when i have in my table "Links" in a field a value "25000".
How can i print this out with a seperator, e.g. "25.000"?

Is that possible?

Greetings,

Coyu
Quote Reply
Re: [Coyu] Seperator in number, like "25.000" In reply to
Have a look at the resourse section for a global "Total Formatted" or similar.

Its for the total links count formatted as you wanted so this could be changed to suit.

Code:
sub {
my $total = $DB->table('Links')->count ( {isValidated => 'Yes'});
$total =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
return $total;
}

Regards

minesite
Quote Reply
Re: [minesite] Seperator in number, like "25.000" In reply to
Hey minesite,

Thank you very much - it works fine, but when i have a big number like 4134535 (over 4 million), i get now this result: "4134.535" ,-)

Is there a possibility to make every thousand a seperator?

Thanks in advance!
Coyu
Quote Reply
Re: [Coyu] Seperator in number, like "25.000" In reply to
I'm sure there is, just do the seach for Grand Total Formatted or similar and I'm sure you'll find the answer.

Regards

minesite