Displaying Mixed Numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg25124] Displaying Mixed Numbers
- From: Jim Graber <jgraber at my-deja.com>
- Date: Sun, 10 Sep 2000 03:14:44 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
While working with my third grader, I discovered the need to make 5/3 display and print as 1 2/3 so she can check her homework. I couldn't find a way to do this easily, so I wrote the following which does the job. Is there an easier or better way? Thanks. Jim Graber Mix1[x_] := { Quotient[Numerator[x], Denominator[x]], Mod[Numerator[x], Denominator[x]]/Denominator[x]} Mix[x_] := Print[Mix1[x][[1]], Mix1[x][[2]]]; Sent via Deja.com http://www.deja.com/ Before you buy.