JKamue / SpaceFlight

Rocket simulator that will probably never get finished
GNU General Public License v3.0
9 stars 1 forks source link

Implemented Issue #44, class to add Decimalpoints is implemented #64

Closed SebastianFay-git closed 4 years ago

JKamue commented 4 years ago

You forgot to actually implement it in the InfoScreen as described in the ticket: https://github.com/JKamue/SpaceFlight/issues/44

You also have redundancies in your code. Instead of writing

public static string Add(float x, int round)
{
    string theoneandonly = Convert.ToString(Math.Round(x, round));
    return AddDecimalpoints(theoneandonly);
}

public static string Add(double x)
{
     string theoneandonly = Convert.ToString(x);
     return AddDecimalpoints(theoneandonly);
}

you should be able to write

public static string Add(double x, int round) => Add(Math.Round(x ,round));

public static string Add(double x) => AddDecimalpoints(Convert.ToString(x));

that way you only have to round once and you only have to convert to string once.

You also have some strange setup with your git / visual studio. Every time you push the csproj or files like that you change the whole formatting.

Also please rename the string and string array variables. Write them camelCase and give them better names