General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 23rd, 2003, 12:32 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 6
perform check on Currency Field

How would you perform a check on a form field that would contain a monetary data.

In other words,...for USD you would have $10.00 or $100,000.00

but in other currencies you have different symbols, etc, etc.

so what kinda of checks can you do to ensure that what is entered is an actual currency value?


does that make sense?
__________________
-- Jason

Reply With Quote
  #2  
Old June 23rd, 2003, 05:48 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Personally if it was up to me, i would use a separate drop down box for the three digit international currency style for example $ can be us dollar and singapore dollar and so many other similar stuff. So i would use USD instead , maybe thats just me

a drop down box for the currency name and a text box just next to it for the amount .

like the logic ? dont like the logic? please say
__________________
Hungry for Code

Programming works best with a team over one single person

Reply With Quote
  #3  
Old June 23rd, 2003, 06:18 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 6
yeah that is a good idea,....but how would you store it in a db?

I mean,...would you have 2 fields?

Currency Type
Currency Amount


and then just append the 2 together? and what field type would you set the currency amount to be? int? or varchar?

Reply With Quote
  #4  
Old June 23rd, 2003, 06:33 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i would say store them together with a separator which you can explode later on.

better db normalization


edit :- i dont think int would work in this case. since we have 3 letters in the begining.

Reply With Quote
  #5  
Old June 23rd, 2003, 07:02 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 6
ohh I see,....your saying store it as

"20.00 USD"


I follow now,....varchar it is

Reply With Quote
  #6  
Old June 23rd, 2003, 07:19 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
ya you could do it any format,

how about "USD|2.00" and explode with | as separator

Reply With Quote
  #7  
Old June 23rd, 2003, 07:50 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 6
yeah,....what I was trying to do,...was figure a way to do error checking on that field,...

in other words,...I wouldn't want a user to type in,... 3.00GHJ

see what I mean,....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > perform check on Currency Field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway