- Weight Converter လုပ်နည်း
HTML နှင့် JavaScript ဖြင့် weight converter ကို ဖန်တီးနည်းကို လေ့လာပါ။
အလေးချိန်ပြောင်းစက်
အလေးချိန်တိုင်းတာခြင်းများအကြား ပြောင်းရန် အကွက်တစ်ခုခုတွင် တန်ဖိုးတစ်ခုကို ရိုက်ထည့်ပါ-
Weight Converter တစ်ခုဖန်တီးပါ။
တန်ဖိုးတစ်ခုမှ အလေးချိန်တိုင်းတာမှုတစ်ခုမှ အခြားတန်ဖိုးတစ်ခုသို့ ပြောင်းလဲနိုင်သော ထည့်သွင်းဒြပ်စင်တစ်ခုကို ဖန်တီးပါ။
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ - ပေါင်မှ ကီလိုဂရမ်
<p>
<label>Pounds</label>
<input id="inputPounds" type="number" placeholder="Pounds"
oninput="weightConverter(this.value)" onchange="weightConverter(this.value)">
</p>
<p>Grams: <span id="outputGrams"></span></p>
အဆင့် 2) JavaScript ကိုထည့်ပါ
ဥပမာ - ပေါင်မှ ကီလိုဂရမ်
/* When the input field receives input, convert the value from pounds to kilograms */
function weightConverter(valNum) {
document.getElementById("outputGrams").innerHTML = valNum / 0.0022046;
}
ပေါင်မှ အခြားတိုင်းတာမှုသို့ ပြောင်းပါ။
အောက်တွင်ဖော်ပြထားသောဇယားသည် ပေါင်မှအခြားအလေးချိန်တိုင်းတာခြင်းသို့မည်ကဲ့သို့ပြောင်းရမည်ကိုပြသထားသည်။
Description | Formula | Example |
---|---|---|
Convert from Pounds to Kilograms | kg=lb/2.2046 | |
Convert from Pounds to Ounces | oz=lb*16 | |
Convert from Pounds to Grams | g=lb/0.0022046 | |
Convert from Pounds to Stones | st=lb*0.071429 |
ကီလိုဂရမ်မှ အခြားတိုင်းတာချက်သို့ ပြောင်းပါ။
အောက်တွင်ဖော်ပြထားသောဇယားသည် ကီလိုဂရမ်မှ အခြားအလေးချိန်တိုင်းတာခြင်းသို့ မည်သို့ပြောင်းရမည်ကို ပြသထားသည်။
Description | Formula | Example |
---|---|---|
Convert from Kilograms to Pounds | lb=kg*2.2046 | |
Convert from Kilograms to Ounces | oz=kg*35.274 | |
Convert from Kilograms to Grams | g=kg*1000 | |
Convert from Kilograms to Stones | st=kg*0.1574 |
အောင်စမှ အခြားအတိုင်းအတာသို့ ပြောင်းပါ။
အောက်ဖော်ပြပါဇယားတွင် အောင်စမှ အခြားအလေးချိန်တိုင်းတာခြင်းသို့ မည်သို့ပြောင်းရမည်ကို ပြသသည်-
Description | Formula | Example |
---|---|---|
Convert from Ounces to Pounds | lb=oz*0.0625 | |
Convert from Ounces to Kilograms | kg=oz/35.274 | |
Convert from Ounces to Grams | g=oz/0.035274 | |
Convert from Ounces to Stones | st=oz*0.0044643 |
Grams မှ အခြား Measurements သို့ ပြောင်းပါ။
အောက်တွင်ဖော်ပြထားသောဇယားသည် ဂရမ်မှအခြားအလေးချိန်တိုင်းတာခြင်းသို့မည်ကဲ့သို့ပြောင်းရမည်ကိုပြသသည်-
Description | Formula | Example |
---|---|---|
Convert from Grams to Pounds | lb=g*0.0022046 | |
Convert from Grams to Kilograms | kg=g/1000 | |
Convert from Grams to Ounces | oz=g*0.035274 | |
Convert from Grams to Stones | st=g*0.00015747 |
Stones မှ အခြားသော Measurements သို့ ပြောင်းပါ။
အောက်ဖော်ပြပါဇယားသည် ကျောက်တုံးများမှ အခြားအလေးချိန်တိုင်းတာခြင်းသို့ ပြောင်းလဲနည်းကို ပြသထားသည်။
Description | Formula | Example |
---|---|---|
Convert from Stones to Pounds | lb=st*14 | |
Convert from Stones to Kilograms | kg=st/0.15747 | |
Convert from Stones to Ounces | oz=st*224 | |
Convert from Stones to Grams | g=st/0.00015747 |