Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Is there a function to convert from decimals to fractions?
Solved! Go to Solution.
@pannus0 wrote:
Is there a function to convert from decimals to fractions?
Not ready-made. You would have to program your own.
In real Mathcad (legacy Mathcad, versions 15 and below) there was a formatting option which would display a number with fractions but Prime does not offer this facility.
Try the symbolic keyword confrac.
Success!
Luc
I tried it as you suggested and I get:
That's correct, it means 0 + 1/2.
Did you read the manual? Add ",fraction" to confrac and see what happens.
Success!
Luc
Definitely fractions, but chances are that @pannus0 expected to see 13 + 9/20 🙂
@pannus0 wrote:
Is there a function to convert from decimals to fractions?
Not ready-made. You would have to program your own.
In real Mathcad (legacy Mathcad, versions 15 and below) there was a formatting option which would display a number with fractions but Prime does not offer this facility.
In real mathcad we had (have !):
and the functionality is available in Prime as well, according to the manual.
Luc
Something curious only happens with 0.25,0.25, but when they are numbers for example 0.375 this doesn't happen, any solution?
@LucMeekes wrote:
In real mathcad we had (have !):
and the functionality is available in Prime as well, according to the manual.
Luc
Really? Can you post a link to the corresponding help page in Mathcad Prime Help
I could not find "convert" in Prime and also not in legacy Mathcad 15.
Neither as a function nor as a symbolic keyword.
And "confrac" with modifier "fraction" works the same in Prime as in MC15
Here is a quick hack. The display is all but nice, though.
It should(may) work up to 12 decimals. Using a higher value for N increases the chance for round off errors when using "gcd".
We could determine the power of 10 needed to multiply the number to get an integer using strings. We might convert the absolute value of the fractional part into a string, delete the leading zero and the decimal point (if present) and the length of the string would correspond to the exponent of the power of 10 needed. Nonetheless the main problem still is the ugly display of the result.
In case you are not looking for mixed fractions you may also use the similar "test2".
While the display format as an 1x3 or 1x2 matrix sure isn't clear an nice, we have at least numerical results which could be used for further calculations (whatever they may be).
Of course we could convert the result into a string which makes for a slightly nicer look but could be used for display only.
Best result in Prime I could achieve was with the symbolical evaluation of a simple program
But sure nothing compares with the simplicity of real Mathcad's formatting options:
Prime 11 sheet attached
