Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Sep 21, 2013 at 07:48 AM by Fattie for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by DayyanSisson · Sep 22, 2012 at 05:22 AM · stringintconvert

Turning Int To String (50 > "Fifty")

How would I go about turning an int such as 55 into string "Fifty Five" and being able to compare the two?

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Sep 22, 2012 at 05:33 AM 0
Share

in what language? english, chinese, spanish? the best bet is simply to have an array of strings and use those. it's likely you have a limit of useful numbers.

avatar image DayyanSisson · Sep 22, 2012 at 05:35 AM 0
Share

Well thats what I originally was going to try, and I was going to try looping through the different strings and mix and match until they fit. Unfortunately, there were so many different variables involved in using that method. I can re-try and show you the code I have.

avatar image Fattie · Sep 22, 2012 at 05:39 AM 0
Share

are you now saying you want to ALSO turn a string "fifty" back to an Int 50 ?

you're only hope would be to find a library that attempts to do that. really it has nothing to do with Unity.

you'd be much better asking on stackexchange. be sure to express the question clearly so that people know what you actually want to avoid any time waste

good luck!

avatar image DayyanSisson · Sep 22, 2012 at 07:55 PM 0
Share

Thanks, I was able to get it somewhat working. The code turns an int like 63 into "Six Three." I'll try and find a way around that.

avatar image T27M · Sep 22, 2012 at 08:01 PM 0
Share

As for turning it into a string you would only need to loop 0 - 9. Then take the first digit of the number entered compare it print out the string , repeat for the next digit until the end. I don't think that would be to hard.

Show more comments

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by franky303 · Sep 25, 2012 at 08:41 AM

You might use a C# Hashtable and store all the values predefined, say from 0-100. The hash can be the int, the text can be the value of the hashtable ...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

c# convert int to string 2 Answers

[SOLVED] Convert this line from string to int 1 Answer

Array - Convert Object into Int 5 Answers

Converting a string to an int 2 Answers

GUI.Label shows volume from a slider 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges