Log in  ::  Register  ::  Not logged in

 Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 ISNUMERIC() and REPLICATE() Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, November 24, 2009 7:08 AM
 Right there with Babe Group: General Forum Members Last Login: Monday, November 18, 2013 1:53 PM Points: 773, Visits: 719
 dun (11/24/2009)That's a big number. How do you report that on your financials? Numbers represented in \$000,000,...,000,000? It made me do a search on the net for big number names (see http://www.sizes.com/numbers/big_numName.htm). It was interesting to find that the number 1 billion can mean something different in other countries. Fantastic.You have now ruined my morning ... HAHA ... i am doing the same.
Post #823855
 Posted Tuesday, November 24, 2009 7:16 AM
 SSC Veteran Group: General Forum Members Last Login: Monday, March 18, 2013 7:52 PM Points: 280, Visits: 88
 Not an every day problem for us (hi from France ^^ ), but as we have to communicate in english for international, it is an usual question :D My MCP Transcript (ID : 692471 Access : 109741229)
Post #823860
 Posted Tuesday, November 24, 2009 7:16 AM
 SSCommitted Group: General Forum Members Last Login: Tuesday, November 26, 2013 6:29 AM Points: 1,917, Visits: 89
 Any number of zeros returns 1. So if it is smart enough to know that all the characters are zero and thus must be a number why can't it just check all the characters individually to see if they are 0 to 9? Or is there no such thing as a number larger than a float's maximum value? I just now noticed that it strips away all leading zeros. I guess that answers my own question. SELECT ISNUMERIC(REPLICATE('0', 7690) + REPLICATE('1', 310)) returns 0SELECT ISNUMERIC(REPLICATE('0', 7691) + REPLICATE('1', 310)) returns 1The reason then that the second one returns 1 is that there are really only 309 of them. It only considers the first 8000 characters of the string, meaning there are really only 309 of the digit 1, which we already know returns a 1.
Post #823861
 Posted Tuesday, November 24, 2009 7:17 AM
 Right there with Babe Group: General Forum Members Last Login: Monday, November 18, 2013 1:53 PM Points: 773, Visits: 719
 crussell-931424 (11/24/2009)Any number of zeros returns 1. So if it is smart enough to know that all the characters are zero and thus must be a number why can't it just check all the characters individually to see if they are 0 to 9? Or is there no such thing as a number larger than a float's maximum value? I just now noticed that it strips away all leading zeros. I guess that answers my own question. SELECT ISNUMERIC(REPLICATE('0', 7690) + REPLICATE('1', 310)) returns 0SELECT ISNUMERIC(REPLICATE('0', 7691) + REPLICATE('1', 310)) returns 1The reason then that the second one returns 1 is that there are really only 309 of them. It only considers the first 8000 characters of the string, meaning there are really only 309 of the digit 1, which we already know returns a 1.i agree 0= 000 but 1 <> 111
Post #823862
 Posted Tuesday, November 24, 2009 8:03 AM
 SSC-Dedicated Group: Administrators Last Login: Yesterday @ 10:12 AM Points: 32,273, Visits: 14,526
 It's a bug in the engine, and I'm not sure how many people will run across it, but it might be nice to know this.The explanation has been changed. Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #823904

 Permissions

 Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.