Re: Decimal point in printed numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg41713] Re: Decimal point in printed numbers
- From: Jan Rychter <jan at rychter.com>
- Date: Mon, 2 Jun 2003 04:35:21 -0400 (EDT)
- References: <bavarn$28s$1@smc.vnet.net> <bb1tmg$9bm$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bob Hanlon wrote: > > In article <bavarn$28s$1 at smc.vnet.net>, Jan Rychter <jan at rychter.com> > > wrote: > > I'm generating labels for axes in a plot. If I numericalize (N[]) them, > > I get a decimal point after each number, even if there is no fractional > > part. If I don't I risk getting rationals (1/2). What is the preferred > > solution? > > > > I guess I could either convert everything to reals (using N[]) and > > change the printed representation (but I couldn't find out how to get > > rid of the decimal point reading the manuals), or try to stick with > > precise numbers and only convert if fractions result. Is there a way to > > do that? > Use a Rule > ticklist /. x_Rational :> N[x] Thanks of all the answers -- this one was the most accurate and the solution works very well indeed. --J.