app/controllers/anoubis/data/convert.rb
##
# Convert value from database to view format for 'integer' type
# @param key [Symbol] field's identifier in {Anoubis::Etc::Data#fields self.etc.data.fields} structure
# @param value [String] value from database
Convert value from database to view format for 'integer' type
Convert value from database to view format for ' integer ' type
def convert_db_to_view_value_number(key, value)
        return { key => self.etc.data.fields[key].error_text } if !value
        return { key => value.to_s.to_i } if self.etc.data.fields[key].precision == 0
        return { key => format('%.' + self.etc.data.fields[key].precision.to_s + 'f', value) }
      end
def convert_db_to_view_value_number ( key , value ) return { key => self . etc . data . fields [ key ] . error_text } if ! value return { key => value . to_s . to_i } if self . etc . data . fields [ key ] . precision == 0 return { key => format ( '%.' + self . etc . data . fields [ key ] . precision . to_s + 'f' , value ) } end
Convert value from database to view format for 'integer' type
Convert value from database to view format for ' integer ' type
key
field's identifier in {Anoubis::Etc::Data#fields self.etc.data.fields} structure
field ' s identifier in { Anoubis :: Etc :: Data#fields self . etc . data . fields } structure
value
value from database
value from database