class Kelvin::Locale

Overview

The Locale defines if temperatures should be displayed in °C or °F.

Defined in:

kelvin/locale.cr

Constant Summary

FAHRENHEIT_LOCALES = ["_US", "_BZ"]

Class Method Summary

Class Method Detail

def self.celcius? #

Returns true if the current locale suggests that degrees Celcius should be used.

The opposite #fahrenheit?


[View source]
def self.fahrenheit? #

Returns true if the current locale suggests that degrees Fahrenheit should be used.

Only a few countries use Fahrenheit as their official scale: the United States, Belize, Palau, and the British Territories of the Bahamas and the Cayman Islands. Note that even though Liberia and Myanmar use imperial measurements they use °C for temperature.

For some purposes (cooking) °F is still widely used in Canada and other places. This method cannot know your purpose so it will ignore that.


[View source]
def self.locale #

returns the locale that we use to determine the preferred temperature scale.


[View source]