discourse/lib/theme_settings_manager/float.rb

16 lines
251 B
Ruby

# frozen_string_literal: true
class ThemeSettingsManager::Float < ThemeSettingsManager
def self.cast(value)
value.to_f
end
def value
self.class.cast(super)
end
def value=(new_value)
super(self.class.cast(new_value))
end
end