Hi,
I have not used variable Float in a long long time and need reminding...
I want to be able to keep a track of weight... I have made WeightAdded Float variable and set it to 0.00.
You place coins on a scale. Each time you add a coin the scales show it's weight via a label.
As you add coins the weight increase.
Do I, as like an int variable adjust weight by:
WeightAdded +=1.2 // for exmple.
A label will keep track of the total weight..
TotalWeight.Text=(String.Format("%d",WeightAdded));
Am I on the right track?
Cheers
You need to use "%f" when printing floats.
Also, there is a way to control how many digits after "." you want printed, using format like "%.2f" - prints 2 digits after point max.
Cheers Crimson..
Got the 'cannot change int to float'... Text is not a public member of Float..
???
EDIT: i think I forget to add the correct Label.. trying...
LWEIGHT.Text=(String.Format("%.2f",WeightAdded)); //seems to work ok
Cheers Crimson (nod)