	FUNCTION NDEC(DSP)
C
C	   Routine to return the number of decimal places in the
C	   d-spacing DSP.  Ndec can range from a minimum of 1 to a
C	   maximum of 4.  This routine is designed only for use with
C	   the photocomp programs to allow trailing zeros to be stripped
C	   off.
C
C	   By: Mark Holomany, JCPDS     Date: 19-Jul-1984
C
C
	REAL  DSP

	INTDSP = NINT(DSP*10000)

	NDEC = 1
	IF(MOD(INTDSP,1000) .EQ. 0) RETURN
	NDEC = 2
	IF(MOD(INTDSP, 100) .EQ. 0) RETURN
	NDEC = 3
	IF(MOD(INTDSP,  10) .EQ. 0) RETURN
	NDEC = 4
	RETURN
	END
