丸めに問題があります。私はユーザーによって入力された2つの数字を分割します。私は常に「0」または整数のいずれかを取得します。C#の小数点以下3桁の数字
waistMeasurment
と
heightMeasurment
が
int
ているので、おそらくです
public static void GetRatios()//This method attains the users ratio inputs
{
double ratioCalc = waistMeasurment/heightMeasurment; //Calculates the ratio
ratio = Math.Round((Decimal)ratioCalc, 3, MidpointRounding.AwayFromZero); //Round the answer to 3 decimal places 'ratio' is initialised in the class
}
'ダブルratioCalc =(ダブル)waistMeasurment/heightMeasurment' – dotctor
病気私の投稿を更新してください。 – BobFisher3
@doctorは完璧に動作しました。みんなありがとう! – BobFisher3