Engineering notation in C#?

前端 未结 9 2185
离开以前
离开以前 2020-12-03 17:44

Is there any code out there (or a built-in function) which allows outputting a floating point number in engineering notation?

For example, 1.5e-4 would

9条回答
  •  旧巷少年郎
    2020-12-03 18:19

    To solve this problem, you want to create a class (call it Engineering) which inherits from Float on which you override the ToString() member.

    Edit: Okay, I understand the issue now. Still, the solution is subclassing.

提交回复
热议问题