Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: PaddedForm bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47891] RE: [mg47877] PaddedForm bug?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 29 Apr 2004 19:39:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Konstantin,

Try...

Table[ToString[PaddedForm[t, {3, 2}]], {t, 0, 1, 0.05}]

or unless you have a good reason for strings...

Table[PaddedForm[t, {3, 2}], {t, 0, 1, 0.05}]

Mathematica pads an extra place for the sign as you can see with

Table[PaddedForm[t, {3, 2}], {t, -0.1, 1, 0.05}]

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Konstantin L Kouptsov [mailto:kouptsov at wsu.edu]
To: mathgroup at smc.vnet.net


Hello mathgroup,

This works as expected:

In:= Table[ToString[PaddedForm[t, {1, 2}]], {t, 0, 1, 0.1}]

Out:= { 0.00,  0.10,  0.20,  0.30,  0.40,  0.50,  0.60,  0.70,  0.80,  0.90,
1.00}

This gives wrong output:


In:= Table[ToString[PaddedForm[t, {1, 2}]], {t, 0, 1, 0.05}]

Out:= { 0.00,  0.05,  0.10,  0.20,  0.20,  0.30,  0.30,  0.40,  0.40,  0.50,
0.50, 0.60,  0.60,  0.70,  0.70,  0.80,  0.80,  0.90,  0.90,  1.00,  1.00}

Should be 0.00, 0.05, 0.10, 0.15, 0.20, 0.25,...

A bug?





  • Prev by Date: RE: Mapping / GIS Applications
  • Next by Date: Re: ListPlot3D with holes
  • Previous by thread: Re: PaddedForm bug?
  • Next by thread: RE: Re: PaddedForm bug?