添加项目文件。
This commit is contained in:
28
MoviconWebApi/API/ClearStaticApi/Mapper.cs
Normal file
28
MoviconWebApi/API/ClearStaticApi/Mapper.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace MoviconWebApi.API.ClearStaticApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 清洗统计数据映射工具类
|
||||
/// </summary>
|
||||
public static class Mapper
|
||||
{
|
||||
/// <summary>
|
||||
/// 格式化小数为两位小数的字符串
|
||||
/// </summary>
|
||||
/// <param name="value">原始值</param>
|
||||
/// <returns>格式化后的字符串</returns>
|
||||
public static string FormatDecimal(decimal value)
|
||||
{
|
||||
return value.ToString("0.00");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 格式化日期时间为yyyy-MM-dd HH:mm:ss格式
|
||||
/// </summary>
|
||||
/// <param name="dateTime">日期时间</param>
|
||||
/// <returns>格式化后的字符串</returns>
|
||||
public static string FormatDateTime(DateTime dateTime)
|
||||
{
|
||||
return dateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user