Hi alya14,
Math.Abs function is use to return the absolute value of a specified number and 16-bit signed integer.
Please refer below sample.
HTML
<asp:Label ID="lblMessage" runat="server" />
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
lblMessage.Text = (IntToDoubleConverter(186520, 4)).ToString();
}
public static decimal IntToDoubleConverter(int Num, int DecPlace)
{
return new decimal(Math.Abs(Num), 0, 0, Num < 0, (byte)DecPlace);
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
lblMessage.Text = (IntToDoubleConverter(186520, 4)).ToString()
End Sub
Public Shared Function IntToDoubleConverter(ByVal Num As Integer, ByVal DecPlace As Integer) As Decimal
Return New Decimal(Math.Abs(Num), 0, 0, Num < 0, CByte(DecPlace))
End Function
Screenshot