Methods “的对立面是什么?”;格式";?
我正在创建一个业务项格式化程序(spread),其中显示时,我希望在将数字乘以100后显示数字,出于所有计算目的,我希望从display(文本框)中读取数字,将其解析为双倍,然后将其除以100Methods “的对立面是什么?”;格式";?,methods,naming-conventions,Methods,Naming Conventions,我正在创建一个业务项格式化程序(spread),其中显示时,我希望在将数字乘以100后显示数字,出于所有计算目的,我希望从display(文本框)中读取数字,将其解析为双倍,然后将其除以100 SpreadFormatter { public string Format(double originalValue){ //Please dont mind this logic/approach. I am just represeting the scenario.
SpreadFormatter {
public string Format(double originalValue){
//Please dont mind this logic/approach. I am just represeting the scenario.
return (originalValue * 100).ToString();
}
public double SuggestAName(string currentValue){
//Please dont mind this logic/approach. I am just represeting the scenario.
return Double.Parse(currentValue)/100 ;
}
}
我正在为上面的“SuggestAName”方法寻找一个合适的名称
谢谢你的关注。我倾向于认为
解析
是格式的反面。或者我选择“from”和“to”,例如ToDisplayFormat
和fromsplayFormat
公共双解析(字符串当前值)