You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#region 文件说明
/*-----------------------------------------------------
* 版权所有 c 2024 jdfcd
* CLR版本 4.0.30319.42000
* 命名空间 DQ.Construction.NewLook.Utility
*
* 创建者pnpe
* 电子邮件pnpe@qq.com
* 创建时间2024/6/28 10:09:43
*/
#endregion 文件说明
namespace System
{
/// <summary>
/// The number extensions.
/// </summary>
public static class NumberExtensions
{
/// <summary>
/// Tos the fixed.
/// </summary>
/// <param name="t">The t.</param>
/// <returns>A T.</returns>
public static double? ToFixed(this double? t, int len)
{
if (t.HasValue)
{
return Math.Round(t.Value, len);
}
return t;
}
/// <summary>
/// Tos the fixed.
/// </summary>
/// <param name="t">The t.</param>
/// <returns>A T.</returns>
public static double ToFixed(this double t, int len)
{
return Math.Round(t, len);
}
}
}