Skip to content

Instantly share code, notes, and snippets.

@117
Created January 14, 2021 03:40
Show Gist options
  • Save 117/8058b53400df01425436ba14a0cb2d18 to your computer and use it in GitHub Desktop.
Save 117/8058b53400df01425436ba14a0cb2d18 to your computer and use it in GitHub Desktop.
export function change(params: { from: number; to: number; factor?: 1 | 100 }) {
return ((params.to - params.from) / params.from) * (params.factor ?? 100)
}
export default {
change: change,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment