# Re: ruby equivalent PHP function is\_numeric?

**URL:** <https://www.ruby-forum.com/t/re-ruby-equivalent-php-function-is-numeric/76344>\
**Category:** Ruby\
**Created:** [November 17, 2006, 6:48pm UTC](https://www.ruby-forum.com/t/re-ruby-equivalent-php-function-is-numeric/76344 "2006-11-17T18:48:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 17, 2006, 6:48pm UTC](https://www.ruby-forum.com/t/re-ruby-equivalent-php-function-is-numeric/76344/1 "2006-11-17T18:48:52Z")

</div>

From: Paul L. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> What purpose does the underscore play? I see that it is  
> accepted, I just  
> can’t figure out why. I have never seen it as part of proper numeric  
> syntax, anywhere, in three decades in this business.
> 
> a = 1\_2\_3\_4\_5\_6\_7 # =\> 1234567

big = 10000000  
Quick, is that 1e6 or 1e7 or 1e8?

vs.  
big = 10\_000\_000

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 17, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/re-ruby-equivalent-php-function-is-numeric/76344/2 "2006-11-17T23:05:38Z")

</div>

Gavin K. wrote:

> vs.  
> big = 10\_000\_000

You mean, avoid ambiguous locale-specific group separators “,|.”, yes?

Interesting. Never saw that before. Plenty of underscores, none of them  
in  
numbers.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [November 18, 2006, 8:01pm UTC](https://www.ruby-forum.com/t/re-ruby-equivalent-php-function-is-numeric/76344/3 "2006-11-18T20:01:16Z")

</div>

----- Original Message -----  
From: “Paul L.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Newsgroups: comp.lang.ruby  
To: “ruby-talk ML” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Friday, November 17, 2006 5:05 PM  
Subject: Re: ruby equivalent PHP function is\_numeric?

> > big = 10000000  
> > –  
> > I think more for input convenience  
> > x = 10000000 =\> 10000000  
> > y = 10\_000\_000 =\> 10000000  
> > z = 10,000,000 =\> [10, 0, 0]
