# Re: Negative Numbers

**URL:** <https://www.ruby-forum.com/t/re-negative-numbers/98297>\
**Category:** Ruby\
**Created:** [July 13, 2006, 6:23pm UTC](https://www.ruby-forum.com/t/re-negative-numbers/98297 "2006-07-13T18:23:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [July 13, 2006, 6:23pm UTC](https://www.ruby-forum.com/t/re-negative-numbers/98297/1 "2006-07-13T18:23:24Z")

</div>

> I’m just getting started with Ruby and was wondering if there  
> is a way  
> to translate negative numbers into their positive equals.  
> i.e turning  
> -7 into 7. Thanks for any help.

Use the .abs method

irb(main):001:0\> -7.abs  
=\> 7

Regards,

Dan

This communication is the property of Qwest and may contain confidential  
or  
privileged information. Unauthorized use of this communication is  
strictly  
prohibited and may be unlawful. If you have received this communication  
in error, please immediately notify the sender by reply e-mail and  
destroy  
all copies of the communication and any attachments.
