Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 914
Manish Basantani Avatar asked Oct 20 '25 05:10

Manish Basantani


1 Answers

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.

like image 162
T.J. Crowder Avatar answered Oct 22 '25 04:10

T.J. Crowder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!