There's no general agreement on how to compute a confidence interval for the median.
But the computation here https://www.statology.org/confidence-interval-for-median/ should be a good starting point. The issue is that the way the z-value is computed is not explained. The median values distribution type is a key hypothesis to assess to compute it accordingly.
Once the error margin is computed, computing the margin of error in percent and displaying it the same way as for the average is trivial.
There's no general agreement on how to compute a confidence interval for the median.
But the computation here https://www.statology.org/confidence-interval-for-median/ should be a good starting point. The issue is that the way the z-value is computed is not explained. The median values distribution type is a key hypothesis to assess to compute it accordingly.
Once the error margin is computed, computing the margin of error in percent and displaying it the same way as for the average is trivial.