My application makes a lot of calculations, then stores them in a database. One of the lines looks like this:
1,3456.2347876653,1234.5678903614,descriptor
I don't have any control on the number of digits after the decimal during the calculation since they are being multiplied by functions of angles.
I use the following code to store the above line
filewrite(c,coord(0) & "," & coord(1) & "," & coord(2) & "," & coord(3))
The values are retrieved using strsplit(variable,",")
Circumstances now require that I reduce the number of digits after the decimal
Here is the code to do that:
filewrite(c,coord(0) & "," & format(coord(1),"N5") & "," & format(coord(2),"N5") & "," & coord(3)
When I do that, here is what the line of numbers looks like:
1,3,456.23478,1,234.56789,descriptor
Extra commas for the 'thousands' separator, negating my use of strsplit
Is there a way to suppress the commas and still be able to set the number of digits after the decimal?
I prefer NOT to change the separator when using strsplit.
Thanks, Jim Schuchert
1,3456.2347876653,1234.5678903614,descriptor
I don't have any control on the number of digits after the decimal during the calculation since they are being multiplied by functions of angles.
I use the following code to store the above line
filewrite(c,coord(0) & "," & coord(1) & "," & coord(2) & "," & coord(3))
The values are retrieved using strsplit(variable,",")
Circumstances now require that I reduce the number of digits after the decimal
Here is the code to do that:
filewrite(c,coord(0) & "," & format(coord(1),"N5") & "," & format(coord(2),"N5") & "," & coord(3)
When I do that, here is what the line of numbers looks like:
1,3,456.23478,1,234.56789,descriptor
Extra commas for the 'thousands' separator, negating my use of strsplit
Is there a way to suppress the commas and still be able to set the number of digits after the decimal?
I prefer NOT to change the separator when using strsplit.
Thanks, Jim Schuchert