prasson_ibm wrote:..But still we have question on IsValidDecimal() why it is not working as expected...
IsValidDecimal takes a DECIMAL as the parameter and checks for the other possible errors. Thus using IsValidDecimal("Hello") implictly converst "Hello" to a decimal, resulting in 0, which in turn is a valid decimal.
chulett wrote:Interesting... if it's already in a decimal data type, what 'possible errors' are we talking about? Precision and scale?
That confused me as well as it doesn't seem to make sense, but as you noted it is the scale and precision as well as the zero-value-flag that is checked for.
I think you'll find that all the IsValid... functions expect a string as the principal argument. They report whether the string could be validly converted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
IBM wrote:They said that the parameter of isValidDecimal had to be a decimal value.
They promised to enhance the document to avoid misleading although it would take a while.
That means isValidDecimal needs a proper decimal as an input.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.