“格式”的反义词是什么?

时间:2010-11-29 09:30:51

标签: methods naming-conventions

我正在创建一个业务项格式化程序(spread),其中显示我希望在将它乘以100之后显示数字,并且出于所有计算目的,我想从显示中读取数字(TextBox),将其解析为double和然后除以100。

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”方法寻找合适的名称。

感谢您的关注。

2 个答案:

答案 0 :(得分:5)

我倾向于认为ParseFormat相反。不管怎样,或者我采取“从”和“到”的方式,例如ToDisplayFormatFromDisplayFormat

答案 1 :(得分:0)

public double Parse(string currentValue)