Colin Weltin-Wu
02/24/2025, 8:40 PMsprintf ? My issue arises when I do something like
set fname = 'device_char_dc_{$DEVNAME}_wid{$&wid_curr}_len{$&len_curr}_vbs{$vbs_curr}_vgs{$vgs_curr}.raw'
Once in a while, for a 0 value, I get something like
device_char_noise_nfet1p8lvt_wid0.5_len0.15_vbs0_vgs-5.55112E-17.raw
This is not a simulator output variable, i.e., subject to ngspice tolerance, it’s just the result of set vgs_curr = 0Tim Edwards
02/25/2025, 7:57 PMlet vgs_curr_print = $vgs_curr
set fname = '... {$&vgs_curr_print} ...'
just because different variable types act differently and may have different numerical formats. If that doesn't work, then maybe just try to round it to hundredths:
let vgs_curr_print = floor($vgs_curr * 100) / 100
but take all that with a grain of salt. . . I often find myself struggling with variable formats in ngspice.