LTspice - limiting the number of decimals

This will help (I think :) )
 

Attachments

  • Draft1.asc
    778 bytes · Views: 75
  • Draft1.png
    Draft1.png
    39.3 KB · Views: 113
Replace the math-block with this

;================================================= ====================================
; === FdWs Rounding functions by Frans de Wit for Signature Origin (diyAudio.com)
; === Truncate round to a fixec fixed number of figures
;================================================= ====================================
;V=sgn(v(inp,inn))(round(abs(v(inp,inn))/(10**floor(log10(abs(v(inp,inn)))-2)))(10**floor(log10(abs(v(inp,inn)))-2))); B-source formula for 3 figures
;V=sgn(v(inp,inn))(round(abs(v(inp,inn))/(10**floor(log10(abs(v(inp,inn)))-5)))(10**floor(log10(abs(v(inp,inn)))-5))); B-source formula for 6 figures
.func rndx(a,x) {sgn(a)(round(abs(a)/(10**floor(log10(abs(a))-(x-1))))(10**floor(log10(abs(a))-(x-1))))}; Function for x figures
.func rnd3(a) {sgn(a)(round(abs(a)/(10**floor(log10(abs(a))-2)))(10**floor(log10(abs(a))-2)))}; Function for 3 figures
.func rnd6(a) {sgn(a)(round(abs(a)/(10**floor(log10(abs(a))-5)))(10**floor(log10(abs(a))-5)))}; Function for 6 figures
;{sgn($)(round(abs($)/(10**floor(log10(abs($))-2)))(10**floor(log10(abs($))-2)))}; Function for 3 figures on .op data label
;{sgn($)(round(abs($)/(10**floor(log10(abs($))-5)))(10**floor(log10(abs($))-5)))}; Function for 6 figures on .op data label
This is day 2 for me with LTspice and I don't understand "replace the math block" with the code. What is the math block and where do we enter the code? Like other posters, I have many nodes I would like to have displayed only 3 digits, but don't want to edit each one individually. It sounds like your method will be a global change...I just don't understand how to implement it.

Thanks for your help.

Cheers