Re: Decimal point in printed numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg41583] Re: Decimal point in printed numbers
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 28 May 2003 04:57:19 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bavarn$28s$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
Plot[Sin[x], {x, 0, 2Pi},
Frame -> True,
FrameTicks -> {If[! IntegerQ[#], N[#], #] & /@ Table[i, {i, 0, 6,
1/2}],
Automatic}]
Regards
Jens
Jan Rychter 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?
>
> --J.