Subtract value with dollar symbol

Can we subtract value like $123.09-$123.16 direct or I need to remove $ then subtract…?

Hi @Aditya10989
U can do one thing based on strvar1.ToString.Replace(“$”,“”)

and then do the substraction

Thanks
Ashwin S

@AshwinS2 thanks for reply.Can I directly subtract like this in assign variable
loss_cal=Convert.ToDecimal(row.Item(4).ToString.Replace(“$”,“”)) -
Convert.ToDecimal(row.Item(7).ToString.Replace(“$”,“”))
when I try this I am getting output zero.
or I need to create variable for each row like val=row.Item(4).ToString.Replace(“$”,“”)
then do calculation or can I do direct

Hi @Aditya10989

Even if you try both the ways you will get the same output

Thanks
Ashwin S

I have value but after calculation o/p show zero value

Can you try converting these values to double before substracting and check the value?