Thread Subject: fraction instead of decimal

Subject: fraction instead of decimal

From: Jimmy

Date: 7 Jun, 2005 23:37:14

Message: 1 of 2

Is it possible to display the result in fraction instead of decimal?
For example 1/10 instead of 0.1.

Thanks

Subject: fraction instead of decimal

From: ellieandrogerxyzzy@mindspring.com.invalid (Roger Stafford)

Date: 8 Jun, 2005 04:36:11

Message: 2 of 2

In article <ef0a03f.-1@webx.raydaftYaTP>, Jimmy <ccwang22@gmail.com> wrote:

> Is it possible to display the result in fraction instead of decimal?
> For example 1/10 instead of 0.1.
>
> Thanks
------
  Try 'rats'. It might do what you want.

s = rats(1.357)

s =

  1357/1000

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com