Package flumotion :: Package common :: Module fraction
[hide private]

Module fraction

source code

convert to and from fractions


Version: $Rev: 7036 $

Functions [hide private]
a two sized tuple with 2 integers
fractionFromValue(value)
Converts a value to a fraction
source code
float
fractionAsFloat(value)
Converts a fraction to a float
source code
string
fractionAsString(value)
Converts a fraction to a string
source code
Function Details [hide private]

fractionFromValue(value)

source code 

Converts a value to a fraction

Parameters:
  • value (one of
    • string, unicode
    • number, eg int/float/long
    • two sized tuple
    ) - the value to convert to a tuple
Returns: a two sized tuple with 2 integers
the fraction

fractionAsFloat(value)

source code 

Converts a fraction to a float

Parameters:
  • value (a two sized tuple with 2 integers) - the value to convert to a tuple, can be one of:
Returns: float
fraction representation in float

fractionAsString(value)

source code 

Converts a fraction to a string

Parameters:
  • value (a two sized tuple with 2 integers) - the value to convert to a tuple, can be one of:
Returns: string
fraction representation as a string