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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With