Re: mysql money field type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a function I use. Modify as you wish.

function Price($amount) {
    return ($amount) ? '$'.number_format($amount, 2, '.', ',') : '-';
}

At 04:04 AM 28/06/2004, you wrote:
I have created a database for a local real estate company, and I am having
issues trying to display home prices with commas.  when you get into the
hundreds of thousands of dollars, it is quite difficult to look at home
prices without commas.  I am using mySQL and PhpMyAdmin.  Is there a mySQL
field type that works for this, but also will sort properly? I tried using
VARCHAR, and the display was right, but when I sorted the results by price,
1,200,000 appreared before 230,900.

Any ideas?

Natan Shar

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

. . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. .

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux