String to Number decimali

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

String to Number decimali

Post by sal21 »

I get from a TXT file a string part of line:

Mystring=mid(myline,2 15)

Mystring="000000000123254""

Two prob:

I need to insert the value of mystring in a access field named prezzo, to have in access:

1.232,54

1) how to format the string in numeric value?
2) how to set the propertie of field?

Note:
The lenght of string in linea of TXT are Always 15 digit.
The format of string Is 000000000000000, the last two character Is a decimal value.
Naturally i can have:Mystring="000000000123200"
I need in this case: 1.232,00

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: String to Number decimali

Post by HansV »

Use Mystring / 100

The prezzo field should be a Currency field, with Format set to #.##0,00
Best wishes,
Hans