Im a beginner so this might not be the best answer but couldn't you just keep it as a string and wherever it is being used just just check it with
if (stats.value != nil) {
use stats.value as an Int
} else {
use stats.value as a String
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: