Numeric or Not Numeric

  • Good question. I ran up against an issue in data before where it was not actaully a valid numeric value, but passed the isnumeric test and broke the process upon insert. The only thing I would add beyond the difference in formating between countries is that you could just have some plain bad data like the following that would pass the isnumeric test

    DECLARE @PrincipalAmount VARCHAR(15)SET @PrincipalAmount = '7,0,0,,,0.0,0,,,'

    SELECT ISNUMERIC(@PrincipalAmount)

    Regards,

    Toby

  • kaspencer (2/22/2010)


    <snip>

    I have noticed a mixture of decimal point indicators on invoices these days, and it certainly isn't unusual to get one using the comma [,] as a decimal point rather than the more logical full-stop [.].

    Kenneth Spencer

    <devils advocate>

    Who's to say that the full-stop is more "logical"? Why not the colon or semicolon?

    Why not, indeed, the comma?

    </devils advocate>

    (Living in the Netherlands, I see the comma as decimal separator all the time... )

    Kelsey Thornton
    MBCS CITP

  • Ah, yes, maybe, Kelsey.

    BUT if you are going to call it the "decimal point", then there is only only one punctuation symbol that resembles a point, and that is the full-stop. Surely?

    Otherwise, then let's call it a decimal comma, a decimal exclamation mark, or even a decimal colon!

    As for the thousands separator, the space is completely illogical, as, mechanistically, one doesn't know whether one is dealing with a list of numbers, or continuation of the previous number.

    If ever there is a revolution, let's re-organise separators completely, as follows:

    So that 100,678,830.56 could become 100T678T830D56.

    Only joking!

    Ken.

    You never know: reading my book: "All about your computer" might just tell you something you never knew!
    lulu.com/kaspencer

  • kaspencer (3/2/2010)


    Otherwise, then let's call it a decimal comma

    Maybe you'll be surprised by the fact that the decimal separator IS called 'decimal comma' in many countries: http://en.wikipedia.org/wiki/Decimal_separator#Countries_using_Arabic_numerals_with_decimal_comma 🙂

    Here's a quote from Wikipedia:

    The decimal separator or decimal point or decimal comma is a symbol used to mark the boundary between the integral and the fractional parts of a decimal number in a positional numeral system.

  • we just call it "coma" 😛

  • ISNUMERIC must be one of the least useful of the built-in functions.

    It would be nice to have a function to validate that an input can be CAST or CONVERTed to another type successfully.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply