eAuction
  Not just another Perl script
Google
Welcome, Guest. Please Login or Register


If you use eAuction a lot and like it or if you make money from eAuction or from eAuction-related activities ...
then the project asks you for a donation in favor of the further development.



The forums are protected by
AccessControl
(written by Dieter Werner)
Click here if you want to check your IP against the most important RBLs of the net.
Click here in order to visite the AccessControl forums.


<< Visit the international e Auction Marketplace >>
Buy and sell PC and Consumer Electronic components






  HomeHelpSearchLoginRegister
 



Pages: 1 2 3 
Numbers in the millions (Read 289 times)
ehunyadi
eAuction User
**
Offline

I love Perl

Posts: 6

Numbers in the millions
10/02/05 at 22:11:29
 
Hello!

First of all, thank you for such a great script!  It is very detailed, and not difficult to get started at all!

The only difficulty I am facing is in the formatting of numbers.

We use eAuction for auctioning items in a mutli-player online game where prices are in the millions or hundreds of thousands for most items (virtual money: nothing tangible is sold for real money).

the items are displaying such as this:  250,00,000 for twenty-five million.  We would like it to display as 25,000,000.

Any help in this would be GREATLY appreciated!
Back to top
 
 


Advertising
View Profile   IP Logged
Dieter Werner
Administrator
*****
Offline

Dipl. Paranoiac ®

Posts: 1162
Germany
Gender: male
Re: Numbers in the millions
Reply #1 - 10/04/05 at 10:02:06
 
I will try to change the code of the formatter.
Back to top
 
 

Multimedia file viewing and clickable links are available for registered members only!!  You need to Login or Register!!


Greetings from Germany
Dieter Werner




Advertising
View Profile | WWW   IP Logged
Dieter Werner
Administrator
*****
Offline

Dipl. Paranoiac ®

Posts: 1162
Germany
Gender: male
Re: Numbers in the millions
Reply #2 - 10/04/05 at 11:19:26
 
Open eAmethods.pl
Search the script for sub form_amt_dec
Replace the whole thing with the following
Code:
#-#############################################
# Sub: Amount Formatter (Decimal)
#-#############################################
sub form_amt_dec {
   my $amt = shift;
   my $cent = (split /\D/, $amt)[-1];
   
   (defined $cent and $amt =~ /\D/)
       ?   do {
               $amt =~ s/($cent)$//;
               length $cent < 2 && ($cent .= '0');
           }
       :   ($cent = '00');
   
   $amt =~ s/\D//g;

   $config{'currency'} == 0 #US
       ?   do {
               $amt .= ".$cent";
               $amt =~ s/(\d{1,3})(?=(?:\d{3,3})+(?:\.|$))/$1\,/g;
           }
       :   do {
               $amt .= ",$cent";
               $amt =~ s/(\d{1,3})(?=(?:\d{3,3})+(?:\,|$))/$1\./g;
           };
   
   return $amt;
}


Back to top
 
 

Multimedia file viewing and clickable links are available for registered members only!!  You need to Login or Register!!


Greetings from Germany
Dieter Werner




Advertising
View Profile | WWW   IP Logged
Pages: 1 2 3 


If you like eAuction, please Rate it.
If you don't like eAuction, please Rate it too.


1 is being poor and 10 is being excellent


EveryScript

ip-location


AccessControl - Members Only