Les balances de précision offrent plusieurs unités de poids ----------------------------------------------------------- Exemple: 1 g gramme 1000 mg milligramme 5.000 ct carat 0.0353 oz onces 0.0322 ozt onces de troy 15.43 gn céréal ou grains 0.643 dwt pennyweight 0.200 tl cuillère à café Peser_précis est un petit programme de convertion. ============================================================ Define peser_précis()= Prgm :Local a,b,g,mg,ct,oz,ozt,gn,tl :0→a:0→b:0→g:0→mg:0→ct :0→oz:0→ozt:0→gn:0→dwt:0→tl :setMode(5,2) :©----------------------entrée :Disp "g.....-gramme-...............: 1 " :Disp "mg..-milligramme-........: 2" :Disp "ct....-carat-....................: 3" :Disp "oz...-onces-..................: 4" :Disp "ozt..-onces troy-...........: 5" :Disp "gn...-céréals ou grains-.: 6" :Disp "dwt.-pennyweight-.......: 7" :Disp "tl.....-cuillère à café-.....: 8" :getKey(1) :Request "Votre choix = ",a :If a≥1 and a≤9 Then : Request "Le poids= ",b :Else : Goto fin :EndIf :©----------------------converti en g :If a=1:b→g :If a=2:((b)/(1000))→g :If a=3:((b)/(5))→g :If a=4:b*28.349523125→g :If a=5:b*31.1034768→g :If a=6:((b)/(15.432358352941))→g :If a=7:b*1.5551857669399→g :If a=8:b*0.005→g :©----------------------converti de g :© g→g :g*1000→mg :g*5→ct :((g)/(28.349523125))→oz :((g)/(31.1034768))→ozt :g*15.432358352941→gn :((g)/(1.5551857669399))→dwt :((g)/(0.005))→tl :©----------------------sortie :Disp "gramme...............",g," g" :Disp "milligramme........",mg," mg" :Disp "carat....................",ct," ct" :Disp "onces...................",oz," oz" :Disp "onces de troy.......",ozt," ozt" :Disp "céréal ou grains...",gn," gn" :Disp "pennyweight........",dwt,"dwt" :Disp "cuillère à café...... ",tl," tl" :getKey(1) :Lbl fin :EndPrgm