G-ShadoW Active Member Licensed User Longtime User Jan 22, 2015 #1 Hello, how to calc with % ? B4X: Sub Button1_Click EditText1.Text = ( "135" - "50" ) ' I want 135 - 50% or -10% ??? End Sub Last edited: Jan 22, 2015
Hello, how to calc with % ? B4X: Sub Button1_Click EditText1.Text = ( "135" - "50" ) ' I want 135 - 50% or -10% ??? End Sub
eurojam Well-Known Member Licensed User Longtime User Jan 22, 2015 #2 B4X: EditText1.Text = ( 135 * 0.5 ) ' or 135 * 0.9 if you want -10% Upvote 0
Informatix Expert Licensed User Longtime User Jan 22, 2015 #3 Formula: to add: Value * (1 + (Percentage / 100)) e.g. +50% = Value * 1.5 to subtract: Value * (1 - (Percentage / 100)) e.g. -30% = Value * 0.7 Upvote 0
Formula: to add: Value * (1 + (Percentage / 100)) e.g. +50% = Value * 1.5 to subtract: Value * (1 - (Percentage / 100)) e.g. -30% = Value * 0.7
G-ShadoW Active Member Licensed User Longtime User Jan 22, 2015 #4 eurojam said: B4X: EditText1.Text = ( 135 * 0.5 ) ' or 135 * 0.9 if you want -10% Click to expand... What about -80% Upvote 0
eurojam said: B4X: EditText1.Text = ( 135 * 0.5 ) ' or 135 * 0.9 if you want -10% Click to expand... What about -80%
udg Expert Licensed User Longtime User Jan 22, 2015 #5 Hi, Informatix's post has it all. 80% off (or -80%) = value * 0.2, i.e. 20% of the original value. Upvote 0