seebrand's Forum Posts

  • 6 posts
  • It's a perfect algorithm! the above function solves my problem perfect!

    thanks a lot.

  • Above example is just what i want.but it has some restricts:

    it can process 1 recursive digit such as .3333..., but cannot process 2 or more recursive digit (maybe 6 is enough). for example: 0.142857142857...->1/7 ,0.076923076923...->1/13, which has 6 recursive digit. It also need skip leading digit that may not be recursive, e.g. 0.4777?->43/90 ,that leading 4 is not recursive.

    Maybe more work needed ,it's not a simple task anyway .

    Yann's "DecimalToFraction" is really very useful for me . maybe it could be put plugin to enhance maths function.

    Thanks a lot.

  • thanks a lot. i'll try some method.

  • i mean that float is accurate of 1/3. the problem is how to transfer a repeating decimals (0.33333333) to fraction express (1/3) in order to show ?

  • thanks. but the float is result of some calculating, ie. 2.333333 is result of 8/3.

    so that float number is indefinite. how can i transfer it to a frac string

    2.333333 -> 8/3?

    it cannot be solved by "if else" condition.

    blackhornet supply a good idea, is there a simple method or function? thanks more.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello,I have a problem in process math calculate:

    How to convert a float like 0.33333333 to percent string "1/3"?

    like:

    0.333333333333 -> "1/3"

    0.666666666666 -> "2/3"

    and how to determine transfer Infinity number (ie. result of 1/0) to a special string like "NA"?

    thanks.

  • 6 posts