130
Views
11
Comments
Solved
convert expression value from positive to negative
Question


i want to convert this positive value to negative value, in the expression. 

I use this value in the expression, but the value still positive and does not change to negative

2023-09-15 13-34-43
Sushant Sharma
Solution

Hello Marhta,


Please check the below .oml file, I have created one demo for this, Hope this will help.


Regards

TestNegativeValue.oml
2021-06-02 20-50-04
Márcio Carvalho

Wut?

Just make another if and check if is >0 and if it is multiply by -1

2024-07-05 03-48-32
Marhta

it doesnt working

2023-09-15 13-34-43
Sushant Sharma

Hello Marhta,

Can you please try the following option.

1) Please check if BasicWages is type of Integer.

2) After that try to its Division by -1.

3) use this (Texttointeger(replace(BasicWages,",","")))/-1

2024-07-05 03-48-32
Marhta

thankyou.. i will try it..

2023-09-15 13-34-43
Sushant Sharma
Solution

Hello Marhta,


Please check the below .oml file, I have created one demo for this, Hope this will help.


Regards

TestNegativeValue.oml
2023-10-31 07-36-11
Marlies Quaadgras
Champion

But what is the solution now? I'm curious

2023-10-31 07-36-11
Marlies Quaadgras
Champion

Hi Marhta

Check if the value >0 then multiply by -1. If 0 or <0 you do nothing.

First check if the values is really made negative. 

You can do that with placing the value as a simple expression on the screen, or check it while debugging.

If the conversion is correct, then add the correct format like described above eg. FormatCurrency or FormatDecimal or DecimalToText with any replaces etc.




2024-07-05 03-48-32
Marhta

thankyou.. i will try it..

2026-01-03 13-44-38
Erwin van Rijsewijk
Champion

Maybe start with the source ... What is the datatype of the attribute and what is it's value in the database?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Mahrta,

No need to check for negative and multiply by -1. There's the built-in Abs() function that converts a number to its absolute value. Just use Abs(RecordSummaryFLC.Current.BasicWages).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.