Two points:
    1)  Str(val( '12345.56'), 10, 5) only gives 4 decimal places because you
lose a place to the decimal point.  Using str(val( '12345.56'), 11, 5)
instead will work in the first example, but not in Sytze's second one.
    2)  Neither CSV no Excel support strict types.  Either will always
interpret field content with only numbers, a single decimal point, or a
leading hyphen as numeric.  The only way around this is to export an
additional character such as a tilde (~), pipe (|), or other characters that
don't ever appear in your data, then strip it out when importing back to
FoxPro.

Mike

~~~~~~~~~~~~~~~~~~~~~~

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Sytze de
Boer
Sent: Sunday, February 28, 2016 5:20 PM
To: profoxt...@leafe.com
Subject: Re: Import/Export with CSV

The Supplier code could be letters and number, just letters, or just
numbers.

The supplier code may be 12345.1234567890 It's nothing to do with decimal
point. It's a character.
If the code is ABC12345.1234567890 all is fine.

The import routine is append from file IMPFILE type csv



On Mon, Feb 29, 2016 at 1:15 PM, Joe Yoder <j...@wheypower.com> wrote:

> I only dabble with Excel but I suspect that you can get your expected 
> results by setting it up to use five decimal places instead of two.  I 
> thought you could convert it in Foxpro with str(val( '12345.56'), 10, 
> 5) but for some reason that only gives 4 decimal places even with 
> decimals set to 6.  I guess that leaves string manipulation where you 
> find the location of the dot from the right edge of the trimed string 
> with the RAT function and add as many zero as you need.
>
> I'm curious why the extra zeros are important.
>
> Joe
>
> On Sun, Feb 28, 2016 at 6:36 PM, Sytze de Boer <sytze.k...@gmail.com>
> wrote:
>
> > I have a problem and I hope someone can help
> >
> > I export 3 fields to a CSV file
> > Code C(15), price N(10,2) , supcode C(30)
> >
> > The code and the supcode may be pure numbers Example supcode may be 
> > 12345.56000
> >
> > I make some changes to the price (using Excel) I now import from 
> > this same file and the supcode has changed to 12345.56
> >
> > Whats the best way to overcome this?
> >
> > --
> > Kind regards,
> > Sytze de Boer
> >
> >
> > --- StripMime Report -- processed MIME parts --- 
> > multipart/alternative
> >   text/plain (text body -- kept)
> >   text/html
> > ---
> >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/02cf01d17287$cdf03d00$69d0b700$@PioneerDrama.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to