Turning a negative value to positive

Hello i am using a excel sheet ( thats a sql ) to retreive some numbers. Only problem its when i come to the negative number it only gives me 0. I have tries doing System.text.RegularExpressions.Regex.Replace("-"+price_variable,"-","")

but still spits out 0. How can i make a function that see if its a -number then it turns it into a positive and assign it to a var

?=

@langsem Math.Abs(CDbl("-1")) will give you 1. In the same way you can try for your Purpose

1 Like

shall i change out the number one with my variable?

@langsem Yes, You can Always try and Check :smile:

still gives me 0

@langsem Can you tell me what is the Number you are trying to Convert ?

Worked now, could be a bug i guess