1
joeiscoffee
decimal money for catads

I'm working with the catads module. If I enter say 3.99 for a price the amount inserted is 3.00.
The variable is this I think:
$this->initVar('price', XOBJ_DTYPE_INT, 0, false);

Where would I go to or how do I make it possible to use the decimal places?

Thanks.

2
theCat
Re: decimal money for catads
  • 2004/12/16 16:27

  • theCat

  • Just popping in

  • Posts: 77

  • Since: 2004/2/2 2


I made this choice at the beginning, but it poses problem.

I cannot test at the moment. I think you have to change:
in class/ads.php
line 53
$this->initVar('price', XOBJ_DTYPE_INT, 0, false);
with
$this->initVar('price', XOBJ_DTYPE_TXTBOX, null, false);

in the line 136 and 138
$price
with
$this->db->quoteString($price)

and in your database change the type of column price with:
price varchar(15) NOT NULL default ''
(and also in sql/mysql.sql)

Perhaps I forget something

I think it's not necessary to delete (or comment) this line in submit1.php (2 places)
if ($price != '' && !is_numeric(trim($price) )) {
        
$msgstop.= _MD_CATADS_INVALIDPRICE.'
'
;
        
$price '';
    }

3
joeiscoffee
Re: decimal money for catads

Thanks for your prompt reply.

It will be several hours before I can test.
Will let you know how it goes.

4
joeiscoffee
Re: decimal money for catads

You da man! Got decimals now.


Thanks

Login

Who's Online

333 user(s) are online (240 user(s) are browsing Support Forums)


Members: 0


Guests: 333


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits