Skip to content
Loading
  • Suraj Kumar
    0
    Hello,
    In C# you can convert it as below
    myFloatVariable.ToString("0.00"); //2dp Number
    In SQL Server you can convert it as below
    declare @num float
    set @num = 10
    select CAST(@num AS numeric(10,2))
    Thanks
    0
  • Dharmraj Thakur
    0
    Hellow
     
    Its pretty simple...
     
    int num = 3;
    Console.WriteLine("Number : " + num.ToString("F2"));
    0
  • 0
    in SQL you can write something like this,
     
    1. select cast(column_name as decimal(10,2)) from table_name   
     
    decimal(10,2) means you can have a decimal number with a maximal total precision of 10 digits. 2 of them after the decimal point and 8 before.
     
    Thank you.
    0
  • Vivek Kumar
    0
    Hi,
    Please have a look to below links.
     
    https://stackoverflow.com/questions/20119282/how-to-display-two-digits-after-decimal-point-in-sql-server
     
    https://stackoverflow.com/questions/20119282/how-to-display-two-digits-after-decimal-point-in-sql-server/20119300 
    0