What is the opposite of "Format"?
I am creating a business item formatter (spread) where while displaying i want to display the number after multiplying it by 100, and for all calculation purpose i want to read the number from display (TextBox), parse it to double and then divide it 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 ;
}
}
I am looking for an appropriate name for "SuggestAName" method above.
Thanks for your interest.
I tend to think of Parse
as the opposite of Format
. Either that, or I go the way of "from" and "to", e.g. ToDisplayFormat
and FromDisplayFormat
.
public double Parse(string currentValue)
精彩评论