anchor.diff:  %% Internal functions
   %% ====================================================================
   
  -% Get the largest number that can be displayed
  +% Get the limits on what is displayable
  +-spec get_display_limits(InValue :: float(),
  +                         NumOfDigits :: pos_integer(),
  +                         Inputs :: list(input_attr())) -> 
  +                         {ok, float()} | too_big | too_small | {error, atom()}.
  +                  
  +get_display_limits(InValue, NumOfDigits, Inputs) ->
  +  if (InValue >= 0.0) ->
  +    case get_pos_limit(NumOfDigits, Inputs) of
  +      {ok, MaxDispVal, MinDispPrec} ->
  +        if (InValue =< MaxDispVal) ->
  +          {ok, MinDispPrec};
  +        true ->
  +          too_big
  +        end;
  +
  +      {error, Reason} -> {error, Reason}
  +    end;
  +
  +  true -> % Input value is negative
  +    case get_neg_limit(NumOfDigits, Inputs) of
  +      {ok, MinDispVal, MinDispPrec} ->
  +        if (MinDispVal =< InValue ) ->
  +          {ok, MinDispPrec};
  +        true ->
  +          too_small
  +        end;
  +
  +      {error, Reason} -> {error, Reason}
  +    end
  +  end.
  +
  +% Get the largest positive number that can be displayed
  +% Leave one digit for leading zero
  +% So maximum number of digits to the right of the decimal point is: NumOfDigits-1
   -spec get_pos_limit(NumOfDigits :: pos_integer(),
                       Inputs :: list(input_attr())) -> {ok, float(), float()} | {error, atom()}.
   
  
positive.code:       % display the maximum number possible
        % with maximum precision possible
        % i.e. 4 digits, MaxDisplayValue = 9999
        % MinDisplayPrecision = 0.001 (leave one digit for leading zero)
  
        MaxDisplayValue = math:pow(10, NumOfDigits) - 1.0,
        MinDisplayPrecision = 1.0 / math:pow(10, (NumOfDigits-1)),
        {ok, MaxDisplayValue, MinDisplayPrecision};
  
      {ok, PosPrecision} ->
        % i.e. NumOfDigits = 4, PosPrecision = 2, 
        % MaxDisplayValue = 99.99, MinDisplayPrecision = 0.01
  
        Max = math:pow(10, (NumOfDigits - PosPrecision)),
        MinDisplayPrecision = (1.0 / Exponent),
        MaxDisplayValue = Max - MinDisplayPrecision,
        {ok, MaxDisplayValue, MinDisplayPrecision};
      
      {error, Reason} -> {error, Reason}.
        
  
  
  %% ====================================================================
  %% Tests
  
negative.code:   attrib_utils:merge_attribute_lists(
      block_common:configs(BlockName, ?MODULE, version(), Description), 
      [
        {num_of_digits, {1}}
      ]). 
  
  
  