So i had this line Golddisplay.text = Euro.ToString("f0"); but i updated to this one Golddisplay.text = currencyconverter.Instance.getcurrencyintostring (Euro, false, false); because i needed to converte the currency,but now it shows the decimal numbers and i cant seem to fix it can you guys help?
you can still "ToString" a string. Hell, you could say "myString.ToString().ToString().ToString();" So to solve your problem, change "Golddisplay.text = currencyconverter.Instance.getcurrencyintostring (Euro, false, false);" to "Golddisplay.text = currencyconverter.Instance.getcurrencyintostring (Euro, false, false).ToString("f0");"
Strange... try this instead. Code (CSharp): string tmpString = currencyconverter.Instance.getcurrencyintostring (Euro, false, false); // This will remove every character after (and including) the decimal point Golddisplay.text = tmpString.Substring (0, tmpString.IndexOf ("."));
it works until it reachs 1k...and i just realized my problem it was in the currency converter public string getcurrencyintostring( float valuetoconvert, bool currencypersec,bool currencyperclick){ string converted; if (valuetoconvert >= 1000000) { converted = (valuetoconvert / 1000000f).ToString ("f0") + "Mil"; } else if (valuetoconvert >= 1000) { converted = (valuetoconvert / 1000f).ToString ("f1") + "K"; } else { converted = "" + valuetoconvert ; } if (currencypersec == true) { converted = converted + "Euro/sec" ; } if (currencyperclick == true) { converted = converted + "Euro/click"; } return converted; } and then i put converted = "" + valuetoconvert.toString("f0") ; I didnt realize the proble was in the converter in itself because the display was the one messing up,thanks for the help anyway, few people would try to help so much ur a boss and deserve a folow