Source language: Translate to:

absolute value?

General questions about NeoBook

Moderator: Neosoft Support

absolute value?

Postby yanzco » Sun Jan 25, 2015 9:15 pm

hi guys... any way i can make a number in to an absolute value?..

if its positive. just leave it alone..
but if its negative.. remove negative..

edit.. is Abs = term for absolute value ?


Math "Abs([Minindaldb.Orders.OTotalAmount]-[Minindaldb.Orders.OConsumable])+[Minindaldb.Orders.OCharge]-[Minindaldb.Orders.ODiscount]" "2" "[DueAmount]"
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: absolute value?

Postby dpayer » Mon Jan 26, 2015 7:46 am

Does this work for you?
Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
Math "([OrigValue]*(-1))" "-1" "[newValue]"
If "[NewValue]" ">=" "[OrigValue]"
.need greater than or equal to in case of zero
SetVar "[OrigValue]" "[NewValue]"
Endif
Parsed in 0.006 seconds, using GeSHi 1.0.8.10
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests