Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by mohanrao164 · Jun 01, 2016 at 01:06 PM · c#unity5error message

BigInteger.ToString("F") giving Format Exception

This is the exception i am getting while running the code:

FormatException: format 'F' not implemented System.Numerics.BigInteger.ToString (System.String format, IFormatProvider provider) System.Numerics.BigInteger.ToString (System.String format) GameManager.Start () (at Assets/Scripts/GameManager.cs:38)

Here is my code:

using UnityEngine;

using System.Collections;

using System.Numerics;

using Mono.Math;

public class GameManager : MonoBehaviour {

 System.Numerics.BigInteger mynumber =  System.Numerics.BigInteger.Parse("18000000000000000000000000000000000001" );

void Start () {

     mynumber.ToString ("F" );

}

}

Please Help, what i am doing wrong.

Comment
Add comment · Show 2
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 Dave-Carlile · Jun 01, 2016 at 01:28 PM 0
Share

Please edit your question, select the code, and press the 101010 button to format it properly.

The error message seems pretty clear - "format F is not implemented".

avatar image mohanrao164 Dave-Carlile · Jun 01, 2016 at 01:36 PM 0
Share

@Dave Carlile can u explain little bit i have imported system.numeric.dll to implement biginterger.

where do i find that F ?

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Jun 01, 2016 at 01:44 PM

Well, the error couldn't be much clearer:

format 'F' not implemented System.Numerics.BigInteger.ToString

So you can't use the format F. Actually it looks like the Mono implementation of BigInteger doesn't support ToString with a custom format at all.

I'm not sure which verion of BigInteger Unity is actually using, however i've found an implementation that only supports "X", "G", "D", "x", "g", "d". The Mono.Math implemenation of BitInteger doesn't support ToString with a format string at all. Only ToString which takes a radix uint which defaults to "10".

Comment
Add comment · Show 2 · 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
avatar image mohanrao164 · Jun 01, 2016 at 01:50 PM 0
Share

The version of system.numeric.biginterger is 2.0.5.0 . if i change the version would it help?

avatar image Bunny83 mohanrao164 · Jun 01, 2016 at 01:54 PM 0
Share

As i said i haven't found a mono implementation that supports all the standard number formats. As you might know $$anonymous$$ono is a replica of $$anonymous$$icrosoft's .NET framework and some things are still missing or implemented differently. You might be able to copy a DLL from the .NET framework, but you should be careful about licensing issues if you do so.

avatar image
0

Answer by HarshadK · Jun 01, 2016 at 01:39 PM

You might need to specify the CultureInfo as the second parameter to the ToString such as:

Using a CultureInfo object that is culture-independent:

 mynumber.ToString ("F", CultureInfo.InvariantCulture);

or, English (United States) based CultureInfo object:

 mynumber.ToString ("F", CultureInfo.CreateSpecificCulture("en-US"));
Comment
Add comment · Show 1 · 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
avatar image mohanrao164 · Jun 01, 2016 at 01:45 PM 0
Share

@Harshad$$anonymous$$ , It is not working i am getting the same Exception.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

157 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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

Error upon rebooting Unity - "Associated script cannot be loaded" How can I resolve this? 2 Answers

StartCoroutine error message in C# 1 Answer

Anchor a health bar to a character/enemy 3 Answers

How do I create a Continuous Turn in XR for my VR Rig instead of Snap Turn Provider? 0 Answers

ForcedScopedThreadAttach 0 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