flipandboef
Posts: 107
|
| Posted: 11/07/2006, 7:11 AM |
|
Ok, here's a nice one for all you wiz-kidz out there....
I use an access database for my project and my data is being delivered to me as a CSV file.
I import this into my database without problems...
However, I am struggeling with one issue.. Our products have a Lenght and Width.. The CSV file that is delivered to me has for example the lenght or width written as one big number and I like to convert this to feet an inches...
Example:
In the CSV file it comes as:
Field - Lenght: 8.1667 / Field2- Width: 10.1667
I would like to have it displayed as:
Lenght: 8 Ft, 2 In / Width: 10 Ft, 2 In
Anyone ever converted this way and is able to help me out?
Lemme know.
Thanks all!
|
 |
 |
flipandboef
Posts: 107
|
| Posted: 11/07/2006, 8:30 AM |
|
ok I did found a calculation that can do it within Excel so that already helped big time for me.
However it would be nice to have this done within my ASP pages (within CCS 3)...
So any suggestions would be nice 
For the ones who might have a need for this as well, here's the code you enter in excell:
=IF(A1>=1,INT(A1)&"' ","") & TEXT(MOD(A1,1)*12,"- 0"&IF(ABS(MOD(A1,1)*12-ROUND(MOD(A1,1)*12,0))>1/32," 0/"&CHOOSE(ROUND(MOD(MOD(A1,1)*12,1)*16,0),16,8,16,4,16,8,16,2,16,8,16,4,16,8,16),"")) &""""
Awaiting your replies for a better solution.
|
 |
 |
flipandboef
Posts: 107
|
| Posted: 12/15/2006, 7:40 AM |
|
So no one had ever done this before??? 
Still trying to find a solution....
|
 |
 |
peterr
Posts: 5971
|
| Posted: 12/15/2006, 9:42 AM |
|
You can apply your calculations in the Before Show event of the field. The "Change Control Value" section of the documentation has good examples.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
TheunisP
Posts: 342
|
| Posted: 12/15/2006, 1:30 PM |
|
this is not a CSS problem, but a basic problem understanding VB script - have a look at planetsourcecode.com or w3 school
|
 |
 |
flipandboef
Posts: 107
|
| Posted: 12/15/2006, 2:09 PM |
|
cannot recall I ever stated that it was a "problem"....
Just wondered if someone had the conversion code for it...
|
 |
 |
|