C# Class Andwho.Windows.Helper.Convert

将一个基本数据类型转换为另一个基本数据类型。
Datei anzeigen Open project: JimmyFung/DesktopHelper

Public Methods

Method Description
MmToInch ( float mm ) : float

将毫米转换为英寸

ToChineseStr ( string str ) : string

转换数字金额主函数(包括小数) 数字字符串 转换成中文大写后的字符串或者出错信息提示字符串

ToFloat ( object obj ) : float

将 object 类型转换为 float

如果转换失败,则返回 0

ToInt32 ( object obj ) : int

将 object 类型转换为 int

如果转换失败,则返回 0

ToInt32 ( string str ) : int

将 string 类型转换为 int

Private Methods

Method Description
IsDecimal ( string str ) : bool

判断是否是正数字字符串 如果是数字,返回true,否则返回false

To1Digit ( string str ) : string

将一位数字转换成中文大写数字

To2Digit ( string str ) : string

转换二位数字

To3Digit ( string str ) : string

转换三位数字

To4Digit ( string str ) : string

转换四位数字

ToData ( string str ) : string

转换数字(整数)

ToDecimalStr ( string str ) : string

转换数字(小数部分)

ToDigit ( string str ) : string

转换的字符串(四位以内)

Method Details

MmToInch() public static method

将毫米转换为英寸
public static MmToInch ( float mm ) : float
mm float 毫米
return float

ToChineseStr() public static method

转换数字金额主函数(包括小数) 数字字符串 转换成中文大写后的字符串或者出错信息提示字符串
public static ToChineseStr ( string str ) : string
str string
return string

ToFloat() public static method

将 object 类型转换为 float
如果转换失败,则返回 0
public static ToFloat ( object obj ) : float
obj object 需要转换的数值
return float

ToInt32() public static method

将 object 类型转换为 int
如果转换失败,则返回 0
public static ToInt32 ( object obj ) : int
obj object 需要转换的数值
return int

ToInt32() public static method

将 string 类型转换为 int
public static ToInt32 ( string str ) : int
str string 需要转换的数值
return int