<!-- SPDX-License-Identifier: CC0-1.0 -->
# Worked Output BTFG-OUT-SDG06-001: Canonical Nitrate Unit Normalizer

```js
// SPDX-License-Identifier: CC0-1.0
export function normalizeWaterRow(row) {
  const rawValue = Number(row.value);
  if (!Number.isFinite(rawValue) || rawValue < 0) {
    return { valid: false, reason: "sensor_dropout_or_negative", raw: String(row.value ?? "") };
  }
  const unit = String(row.unit || "").trim().toUpperCase();
  const mgLN = unit === "MG/L-NO3" ? Number((rawValue * 0.2259).toFixed(4)) : Number(rawValue.toFixed(4));
  return {
    valid: true,
    station_id: String(row.station_id || "unknown"),
    mg_l_n: mgLN,
    exceeds_who_guideline: mgLN > 11.3,
    raw_provenance: `${row.value} ${row.unit}`,
  };
}
```
