|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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
|
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
ohh I see,....your saying store it as
"20.00 USD" I follow now,....varchar it is ![]() |
|
#6
|
|||
|
|||
|
ya you could do it any format,
how about "USD|2.00" and explode with | as separator |
|
#7
|
|||
|
|||
|
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,.... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > perform check on Currency Field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|