小编Gus*_*son的帖子

如何逐一增加小数的最小小数部分?

我想用一个增加十进制的最小小数部分,例如

decimal d = 0.01
d++
d == 0.02
Run Code Online (Sandbox Code Playgroud)

要么

decimal d = 0.000012349
d++
d == 0.000012350
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

c# math decimal

9
推荐指数
1
解决办法
2740
查看次数

如何序列化Nullable <bool>?

我想通过将其转换为字符串来序列化可空的bool

public static string SerializeNullableBoolean(bool? b)
{
    if (b == null)
    {
        return "null or -1 or .."; // What to return here?
    }
    else
    {
        return b.ToString();
    }
}
Run Code Online (Sandbox Code Playgroud)

将null值序列化为最合适的字符串是什么?

.net c# serialization boolean nullable

5
推荐指数
2
解决办法
4800
查看次数

标签 统计

c# ×2

.net ×1

boolean ×1

decimal ×1

math ×1

nullable ×1

serialization ×1