Author Topic: Decimal digits written to file  (Read 1676 times)

0 Members and 1 Guest are viewing this topic.

MeasureUp

  • Bull Frog
  • Posts: 465
Decimal digits written to file
« on: May 05, 2014, 03:36:03 AM »
1 of my codes is writting messages to *.txt file.
It works fine until I load it to another pc.
By using it, basically I enter a number then record it to the *.txt file.

Code: [Select]
(setq ABC (getreal "\nABC: "))
(rtos ABC 2 2)
...

For example, my input = "100.5"
then "100.50" is supposely written to the *.txt file.
This is exactly what I get from my 1st pc.

On the 2nd pc, I repeat the same input above and "100.5" is written to the *.txt file.

The following has been set to both pc:
1) "_units" (Drawing Units): Length Precision = 0.0000
2) "-units" = "2"
3) "measureinit" = "1"
4) "measurement" = "1"

What am I missing?
Your helps are much appreciated.

GP

  • Newt
  • Posts: 83
  • Vercelli, Italy
Re: Decimal digits written to file
« Reply #1 on: May 05, 2014, 04:24:01 AM »
Code: [Select]
(setq ABC (getreal "\nABC: "))
100.5
_$

(setvar 'dimzin 1)
1
_$

(rtos ABC 2 2)
"100.50"
_$


(setvar 'dimzin 8)
8
_$

(rtos ABC 2 2)
"100.5"
_$

See this thread:
http://www.theswamp.org/index.php?topic=46864.0;nowap
« Last Edit: May 05, 2014, 04:27:13 AM by GP »

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Decimal digits written to file
« Reply #2 on: May 05, 2014, 06:40:28 AM »

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Decimal digits written to file
« Reply #3 on: May 05, 2014, 08:17:37 PM »
Thanks to your replies.
I noticed that the "dimzin" is set to "0" on my both pcs.
And as the result both pcs get (rtos ABC 2 2) = 100.50
I now change "dimzin" to "1" on my 2nd pc and (rtos ABC 2 2) is the same as 100.50

However, on the 2nd pc, it is written to *.txt as "100.5", not "100.50"
Any other thoughts?

BTW, I also noticed that "dimzin" is saved to drawing.
On both pcs I use the same template when writing to *.txt.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Decimal digits written to file
« Reply #4 on: May 07, 2014, 07:03:08 PM »
I can't think of any other potential causes.
Here is additional info:
My 1st pc runs Win7 Pro while Win7 HP installed in the 2nd pc (the pc which has the problem).

Thanks.