Skip to content

Instantly share code, notes, and snippets.

@phillro
Created October 10, 2018 20:12
Show Gist options
  • Save phillro/08f0976ce4fddc8889c6910f14b6a487 to your computer and use it in GitHub Desktop.
Save phillro/08f0976ce4fddc8889c6910f14b6a487 to your computer and use it in GitHub Desktop.
function scalingBidModifier {
maxScaleFactor = .4
rootScaleValue = $25
scalingFloor = $5
If(bid>scalingFloor){
var modifier = if(bid>=rootScaleValue){
1-maxScaleFactor
} else {
1-((bid/rootScaleValue)*maxScaleFactor)
}
(modifier * bid) > scalingFloor ? (modifier * bid) : bid
}else{
bid
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment