I want to convert a negative int/ double value into positive of the same

double, int

Solution

In `Dart` you can do like this

value.abs()

In `Kotlin` you can do like this

value.absoluteValue

In `JavaScript` you can do like this

Math.abs(value)

Problem

I want to convert a negative int/ double value into positive of the same, and use it for further calculations..i tried using %2 but the value turns out to be -0.0. It would be a great help if someone could help me out with this.

Original source