S smileeomar Member Jan 4, 2012 #1 Hi i have questions first i make calculator when the result be 0 its showed as 0.0 knowing that variable ASDouble
Hi i have questions first i make calculator when the result be 0 its showed as 0.0 knowing that variable ASDouble
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2012 #2 You can use NumberFormat or NumberFormat2 to format the number. Basic4android Search: NumberFormat Upvote 0
S smileeomar Member Jan 5, 2012 #3 thank you but i have another problem when i use sin cos ex sin30 = 0.4999999999999 why this happen i use this equ SinD(lbl.text) and in cos its fine but it showing like this cos 60 = 0.50000000000000 please any fix to this proplem thanks Upvote 0
thank you but i have another problem when i use sin cos ex sin30 = 0.4999999999999 why this happen i use this equ SinD(lbl.text) and in cos its fine but it showing like this cos 60 = 0.50000000000000 please any fix to this proplem thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2012 #4 Did you try NumberFormat? It will round the number as needed. Upvote 0
S smileeomar Member Jan 5, 2012 #5 when i'm using numberformat it will not help me ex i use lbl_Result.Text = NumberFormat(CosD(lbl_Result.Text),0,1) cos(60) = 0.5 its fine cos(30) = 0.9 this is the problem how i could make cos(60) = 0.5 cos(30) = 0.866025 at the same thanks Upvote 0
when i'm using numberformat it will not help me ex i use lbl_Result.Text = NumberFormat(CosD(lbl_Result.Text),0,1) cos(60) = 0.5 its fine cos(30) = 0.9 this is the problem how i could make cos(60) = 0.5 cos(30) = 0.866025 at the same thanks
klaus Expert Licensed User Longtime User Jan 5, 2012 #6 Have you tried this ? B4X: Log(NumberFormat(SinD(30),1,6)) Best regards. Upvote 0
S smileeomar Member Jan 5, 2012 #7 klaus said: Have you tried this ? B4X: Log(NumberFormat(SinD(30),1,6)) Best regards. Click to expand... thank you klaus sooooo much its work :icon_clap: Upvote 0
klaus said: Have you tried this ? B4X: Log(NumberFormat(SinD(30),1,6)) Best regards. Click to expand... thank you klaus sooooo much its work :icon_clap: