Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

InputField - How to display text as currency?

$
0
0
Hi all, I've researched this for some time, just running in to road blocks. I'd like to format the InputField text as it is being typed as currency.

So far, I've tried multiple attempts using different formats, but it comes back as "FormatException" error:
Code (CSharp):
  1.  
  2. // called when an input field value is changed (user input typed)
  3. public void OnInputValueChange()
  4. {
  5.     // ERROR - Not in the correct format
  6.     iField.text = string.Format("{0:C", iField.text);
  7.    
  8.     // ERROR - Not in...
InputField - How to display text as currency?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>