There is `four quarter i.e. Q1, Q2, Q3 and Q4` for each `Fiscal Year(FY)`. I want to print:

* `FY18 Q1` for input `2018.1`
* `FY18 Q2` for input `2018.2`
* `FY18 Q3` for input `2018.3`
* `FY18 Q4` for input `2018.4`

The below code works fine but looking for the better approach.

```
controller.GetFormattedQuarter = function (quarter) {
  if (quarter) {
    var newQuarter = String(quarter).replace("20", "FY");
    if (newQuarter.indexOf(".1") != -1) {
      return newQuarter.replace(".1", " Q1");
    }
    if (newQuarter.indexOf(".2") != -1) {
      return newQuarter.replace(".2", " Q2");
    }
    if (newQuarter.indexOf(".3") != -1) {
      return newQuarter.replace(".3", " Q3");
    }
    if (newQuarter.indexOf(".4") != -1) {
      return newQuarter.replace(".4", " Q4");
    }
  }
}

```