25

I asked a junior dev to convert y axis value to dollars and render the same on a chart. This is what he does.

Comments
  • 6
    aaah... juniors. Ranting behind your back for stupid requests that seem stupid only because they don't understand it, then offering a solution that makes you rant behind their backs.
  • 5
    Just out of curiosity, is it only the `>=` checks that are unneccesarry? Or would you have liked it with single if and `return`
    Or rather a function like

    if (label < 15) {
    e.labelContent = (label == 0 ? "0" : "$150k");
    return;
    }

    var multiplyer = Math.floor(label/15);
    if (multiplyer == 1) {
    e.labelContent = "$500k";
    return;
    }

    e.labelContent = "$" + (multiplyer * 0.5) + "M";
  • 0
    Watching
  • 0
    Using Mono?
  • 0
    Just waiting for the response
  • 0
    Sorry guys, I'm not expecting anything fancy here. I'd prefer two methods - one for converting the y axis values to 'K' value with an appropriate multiplier and other to convert 'K' to 'M' wherever applicable.
  • 1
    @gitpush Yes, Xamarin.
  • 0
    * facepalm intensifies *
  • 0
Add Comment