get_sign

sofia_redux.scan.utilities.utils.get_sign(value, default=0)[source]

Return an integer representation of a sign.

Parameters:
valueint or float or str

The value to parse.

defaultint, optional

The default sign to return.

Returns:
signint

1 for a positive sign, -1 for a negative sign, and 0 for no sign.