homepage Welcome to WebmasterWorld Guest from 23.22.252.150
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library : Charter : Moderators: physics & whoisgregg

Databases Forum

    
Converting a number to a positive number in MySQL
dataguy




msg:4314978
 11:13 pm on May 19, 2011 (gmt 0)

This seems like it would be simple, but I can't figure out how to do it.

I have a value which may or may not be positive, but I need it to be positive every time. Is there a function for this?

 

whoisgregg




msg:4315336
 3:21 pm on May 20, 2011 (gmt 0)

You can get the absolute value using ABS():
http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_abs [dev.mysql.com]

dataguy




msg:4315345
 3:33 pm on May 20, 2011 (gmt 0)

Oh, that's exactly what I was looking for. I should have known that.

Thanks!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved