Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Rajesh Samadia
  Where is Rajesh Samadia?
 Jaipur
 India
 Rajesh Samadia
 Tags
Subject: RE: Convert Number to Character
Thread ID: 345574 Message ID: 345577 # Views: 83 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, May 24, 2012 4:10:54 PM         
   


> Hello Everyone
>
> I want to convert 15.398 to character format
>
> - The number of decimal places is not Known it could be 3,4,5 or more
>
> - STR(15.398,12,5) Result is 15.39800 is not acceptable I need the result as 15.398
>
> - STR(15.390,12,5) Result is 15.39000 is not acceptable I need the result as 15.390
>
> How can this be carried out?
>
> Regards

What you need, colleague Rajesh, is the VFP's TRANSFORM() function.
Unfortunately, it was not yet introduced in VFP6.
However, there are ways to truncate the trailing zeros (this is what you are asking for, as I understand).

Let me ask you this: do you always need 3 decimal digits in that resulting string? If so - Martin Krivka has already answered your question; if not - could you be more specific?

Regards,

Ilya

ENTIRE THREAD

Convert Number to Character Posted by Rajesh Samadia @ 5/24/2012 3:48:30 PM
RE: Convert Number to Character Posted by Martin Krivka @ 5/24/2012 4:04:17 PM
RE: Convert Number to Character Posted by Rajesh Samadia @ 5/24/2012 4:26:39 PM
RE: Convert Number to Character Posted by Martin Krivka @ 5/24/2012 6:00:31 PM
RE: Convert Number to Character Posted by Ilya Rabyy @ 5/24/2012 4:10:54 PM
RE: Convert Number to Character Posted by Rajesh Samadia @ 5/24/2012 4:29:43 PM
RE: Convert Number to Character Posted by Anders Altberg @ 5/24/2012 5:36:28 PM
RE: Convert Number to Character Posted by Ilya Rabyy @ 5/24/2012 7:03:27 PM
RE: Convert Number to Character Posted by Anders Altberg @ 5/26/2012 6:13:34 PM
RE: Convert Number to Character Posted by David Mustakim @ 5/26/2012 6:43:25 PM
RE: Convert Number to Character Posted by Anders Altberg @ 5/26/2012 7:02:46 PM
RE: Convert Number to Character Posted by David Mustakim @ 5/26/2012 8:08:50 PM
RE: Convert Number to Character Posted by Tony Vignone @ 5/26/2012 8:21:21 PM
RE: Convert Number to Character Posted by David Mustakim @ 5/26/2012 8:39:01 PM
RE: Convert Number to Character Posted by tushar @ 5/24/2012 4:45:04 PM
RE: Convert Number to Character Posted by Rajesh Samadia @ 5/26/2012 9:21:13 AM
RE: Convert Number to Character Posted by tushar @ 5/26/2012 1:02:15 PM
RE: Convert Number to Character Posted by Tony Vignone @ 5/24/2012 7:25:58 PM
RE: Convert Number to Character Posted by Rajesh Samadia @ 5/26/2012 9:25:37 AM
RE: Convert Number to Character Posted by Anders Altberg @ 5/26/2012 12:59:30 PM
RE: Convert Number to Character Posted by Tony Vignone @ 5/26/2012 2:57:00 PM
RE: Convert Number to Character Posted by Tony Vignone @ 5/26/2012 5:54:21 PM
RE: Convert Number to Character Posted by David Mustakim @ 5/26/2012 3:14:14 PM
RE: Convert Number to Character Posted by Tony Vignone @ 5/26/2012 8:19:16 PM
RE: Convert Number to Character Posted by David Mustakim @ 5/26/2012 8:49:11 PM
RE: Convert Number to Character Posted by Luis Maria Guayan @ 5/28/2012 1:33:17 AM
RE: Convert Number to Character Posted by Tony Vignone @ 5/28/2012 4:42:39 PM
RE: Convert Number to Character Posted by Norberto Gomez Moure @ 5/29/2012 1:07:39 AM
RE: Convert Number to Character Posted by David Mustakim @ 5/29/2012 7:20:47 AM
RE: Convert Number to Character Posted by Tony Vignone @ 5/29/2012 3:06:41 PM
RE: Convert Number to Character Posted by Norberto Gomez Moure @ 5/29/2012 5:05:08 PM