CustomDistance

Next
 From:  Zooen
10278.1 
good morning,

I am using "CustomDistance" and would like to change the number of decimal places in the X, Y, Z dialog display (it is currently two). I think this must be possible in one of the two files .js or .htm. I was able to translate the texts (it's easy) but for the decimals, I'm in difficulty.
Thank you for your answers

- Zooen

EDITED: 28 Sep 2021 by ZOOEN

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10278.2 In reply to 10278.1 
Hi Zooen,

re:
> I am using "CustomDistance" and would like to change the number of decimal places
> in the X, Y, Z dialog display (it is currently two). I think this must be possible in one of
> the two files .js or .htm.

For this command the number of decimal places is determined by the SetVal() function
inside of the CustomDistance.htm file, with the line marked here with >><<

code:
			function SetVal( name, numval )
			{
			>>      var sval = numval.toFixed( 2 ); <<
		
				window[name].value = sval.replace( /\.*0+$/, '' ); // Remove trailing 0 or .00
			}

If you change it to be numval.toFixed( 4 ); for example it will make 4 decimal places.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Zooen
10278.3 In reply to 10278.2 
There it's done
Thanks Michael

-Zooen

EDITED: 19 Apr 2021 by ZOOEN

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All