php-windows Digest 29 Jun 2004 11:51:15 -0000 Issue 2300

Topics (messages 24075 through 24077):

Re: mysql money field type?
        24075 by: Larry E. Ullman
        24076 by: Ross Honniball

Parsing pageranges
        24077 by: George Pitcher

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
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.

Store the value as a number (integer) but then use a MySQL or PHP function (like PHP's number_format()) to format it with commas.


Larry
--- End Message ---
--- Begin Message ---
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. .

--- End Message ---
--- Begin Message ---
Hi,

I have several systems running which gather, store and process bibliographic
data. I have treated pageranges on the basis of two fields per range - start
and end, with supplemantary ranges available as well.

I've never had to deal with more than 3 ranges in a reference: chapter,
references and notes. Now, a client has asked for 6 ranges. I could
futureproof this by putting 10 ranges in but I got to thinking about how
Pagemaker used to handle prining (and how Micro$oft do now) where I can note
a range as (example) 1-4,6,8-10.

I need to be able to parse this type of string so that I can identify the
number of pages being referenced.

I also need to ensure that the user hasn't entered a mixed range such as
xiii-5 (I know that the second part of that is 1-5 but I don't know what the
highest roman numeral was). I do know how to handle the roman calculations,
so that's a side issue.

I'm guessing that regex is the way to go, but whenever I'm confronted with
it, I look for a chinese interpreter.

Any suggestions?


George in Oxford

--- End Message ---

Reply via email to