Re: Datatype checking in DotNET
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 12:01:29 -0500
Nicholas Sherlock wrote:
Daniel Hobson wrote:Yeah I am doing that now at the moment for example as based on the given
example previously:-
I use StrToFloat, if this fails, it raises an exception (Which is fine of
course).
But what I am trying to achieve here is to ensure the data integrity, does the data meet the float bounds?????
StrToFloat will almost certainly do that too. Give it a try with a really big float, something like 10E1000.
The StrToFloat function ultimately calls System.Double.TryParse(String,NumberStyles,IFormatProvider,out Double) to do the conversion.
Assigning a Double to a Single will throw an ArithmeticException if the result is not finite.
--
Rob
.
- References:
- Datatype checking in DotNET
- From: Daniel Hobson
- Re: Datatype checking in DotNET
- From: Nicholas Sherlock
- Re: Datatype checking in DotNET
- From: Daniel Hobson
- Re: Datatype checking in DotNET
- From: Nicholas Sherlock
- Datatype checking in DotNET
- Prev by Date: Re: Datatype checking in DotNET
- Previous by thread: Re: Datatype checking in DotNET
- Next by thread: Color row of DBGrid
- Index(es):
Relevant Pages
|