function bfitcheckshowequations(showeqnon, datahandle, digits)
%BFITCHECKSHOWEQUATIONS Shows the equations for the fits 
%   BFITCHECKSHOWEQUATIONS(SHOW,DATAHANDLE,DIGITS) shows or removes the 
%   equations according to SHOW, with DIGITS giving the number of digits to show.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.6 $  $Date: 2000/05/22 01:47:28 $

axesH = get(datahandle,'parent'); % need this in case subplots in figure
figH = get(axesH,'parent');

bfitlistenoff(figH)

fitsshowing = find(getappdata(datahandle,'_Basic_Fit_Showing'));

eqnTxtH = getappdata(datahandle,'_Basic_Fit_EqnTxt_Handle');
if ishandle(eqnTxtH)
    figure(figH)
    delete(eqnTxtH);
end

if showeqnon
    eqnTxtH = bfitcreateeqntxt(digits,axesH,datahandle,fitsshowing);
    if ~isempty(eqnTxtH)
        appdata.type = 'eqntxt';
        appdata.index = [];
        setappdata(eqnTxtH,'_bfit',appdata);
    end
else % delete
    eqnTxtH = [];
end
setappdata(datahandle,'_Basic_Fit_EqnTxt_Handle',eqnTxtH);
guistate = getappdata(datahandle,'_Basic_Fit_Gui_State');
guistate.equations = showeqnon;
guistate.digits = digits;
setappdata(datahandle,'_Basic_Fit_Gui_State', guistate);

bfitlistenon(figH)
