You are here: Re: $ sign input « PHP Language « IT news, forums, messages
Re: $ sign input

Posted by Gleep on 04/20/07 18:03

On 20 Apr 2007 06:03:22 -0700, ZeldorBlat <zeldorblat@gmail.com> wrote:

>On Apr 19, 8:42 pm, "Art" <c...@bellsouth.net> wrote:
>> Can anyone help? I've got a text input box where the user occasionally
>> enters $ sign. For example they might enter $90,000 for a dollar amount.
>> The problem i'm having is that my php script is seeing this as a variable.
>> I'm not sure how to get around this problem.
>>
>> Art
>
>How are you using the value of the text box that PHP would parse it as
>a variable? If you have a $ in a string it shouldn't make any
>difference.


I'm not sure I understand your question, let me explain this way. I'm trying to remove extraneous
characters from the dollar amount. Someone types in $90,000 US I only want to save 90000
in the database. If the programmer set up a field in a table called amount and set it to integer -
then the db will be expecting a numbers only. From there one could determine sums or averages or
some other type of calculation from the db. Then when it's time to display a number in currency
format, you would reformat the 90000 to display as $90,000 US or whatever you want.
I don't think it's a wise decision to save the amount as \$90,000 US as string format,
should be just the number alone, because you can do more with it later.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация