私の質問は、kgからポンドとオンスにどのように変換するのですか?
1kg=1000gmおよび2lb3.274 oz(1 lb = 16 oz)
以下を含むファイルを読み取ります。
AとBの重量は3000gmで、重量は90kgです。
したがって、3000 kgの結果は、重量188ポンドと1.6オンスになります。
static void ToLB(double Weight, string type)
{
double Weightgram, kgtopounds;
// lbs / 2.2 = kilograms
// kg x 2.2 = pounds
if (type == "g")
{
// convert gram to kg
Weightgram = Weight * 1000;
// then convert kg to lb
kgtopounds = 2.204627 * Weight;
//convert gram to oz"
Weightgram = Weightgram * 0.035274;
Console.Write("\n");
Console.Write(kgtopounds);
}
// I want to convert each gram and kg to pounds and oz using C#