Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Avoid printing leading zero

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100769] Re: Avoid printing leading zero
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Sat, 13 Jun 2009 06:04:32 -0400 (EDT)
  • References: <h0sc2a$hi2$1@smc.vnet.net>

Use StringDrop

In[16]:= StringDrop["-0.03", {2, 2}]

Out[16]= "-.03"

Cheers-- Sjoerd

On Jun 12, 3:46 am, Jos=E9 Lorenzana <lorenzana.j... at gmail.com> wrote:
> How do you avoid printing the leading zero in -0.03?
> I need to construct the string "-.03" .
>
> Something like this does not work:
> ToString at NumberForm[-0.3, {0, 2}]
>
> Thanks a lot!
>
> Jos=E9



  • Prev by Date: Re: Avoid printing leading zero
  • Next by Date: need a help
  • Previous by thread: Re: Avoid printing leading zero
  • Next by thread: Re: Avoid printing leading zero