/*iWavLen convert real wavelength in A into integer form used in printout */ #include "cddefines.h" #include "taulines.h" #include "iwavlen.h" long iWavLen(EmLine * t) { long int iWavLen_v; # ifdef DEBUG_FUN fputs( "<+>iWavLen()\n", debug_fp ); # endif /* add 0.5 so that integer rounds up */ iWavLen_v = (long)(t->WLAng + 0.5); /* NB - following must be kept parallel with logic in setline and pldata */ if( iWavLen_v > 1000000 ) { iWavLen_v /= 10000; } else if( iWavLen_v > 10000 ) { iWavLen_v /= 1000; } else if( iWavLen_v < 10 ) { /* add 0.5 so that integer rounds up */ iWavLen_v = (long)(t->WLAng*10. + 0.5); } # ifdef DEBUG_FUN fputs( " <->iWavLen()\n", debug_fp ); # endif return( iWavLen_v ); }