1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Ips.Library.Basic
- {
- public static class NumUnitExtensions
- {
- public static int E3(this double source)
- {
- source = Math.Round(source, 6);
- return (int)(source * 1e3);
- }
- public static long E3l(this double source)
- {
- source = Math.Round(source, 6);
- return (long)(source * 1e3);
- }
- public static int E6(this double source)
- {
- source = Math.Round(source, 6);
- return (int)(source * 1e6);
- }
- public static long E6l(this double source)
- {
- source = Math.Round(source, 6);
- return (long)(source * 1e6);
- }
- public static double E3m(this int source)
- {
- return Math.Round(source * 1e-3, 3);
- }
- public static double E3m(this long source)
- {
- return Math.Round(source * 1e-3, 3);
- }
- public static double E6m(this int source)
- {
- return Math.Round(source * 1e-6, 6);
- }
- public static double E6m(this long source)
- {
- return Math.Round(source * 1e-6, 6);
- }
- }
- }
|