23 lines
518 B
C#
23 lines
518 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GraphicsStudy
|
|
{
|
|
public static class DoubleMethod
|
|
{
|
|
/// <summary>
|
|
/// 四舍五入,保留几位小数点
|
|
/// </summary>
|
|
/// <param name="d1"></param>
|
|
/// <param name="i"></param>
|
|
/// <returns></returns>
|
|
public static double Round(this double d1, int i = 0)
|
|
{
|
|
return Math.Round(d1, i);
|
|
}
|
|
}
|
|
}
|