posted 17 years ago
Hi,
I have a field that contains the currency symbol and the amount for the room. The following is the instruction statement from SUN -
I am debating about the following points regarding the validation of currency on the "rate" field. Please execuse me if some of them are pretty basic questions -
1. How many bytes should I allocate for the currency symbol? Can I assume one byte?
2. How will I validate the float/double value after the symbol? Also, can the symbol be the last character in the field value?
3. Depending on the currency, it could have a "." or a "," as the decimal symbol.
4. How many digits can be present after the decimal?
Do you think there is a easy way to validate these or I leaning towards not doing the validation at all and just document it that when data class is directly invoked, users need to enter a valid value?
Or can I make some choices here like - one byte for currency and digits after decimals can be only two and the decimal separtor symbol can be only "." and that the currency symbol should be at the beginning of the field?
Or if there is a way to validate all these, please do let me know.
Thanks
Ravi
[ March 25, 2007: Message edited by: Ravikiran Vishnuvajhala ]
[ March 25, 2007: Message edited by: Ravikiran Vishnuvajhala ]
[ March 25, 2007: Message edited by: Ravikiran Vishnuvajhala ]
[ March 25, 2007: Message edited by: Ravikiran Vishnuvajhala ]