Home > Blockchain >  Cannot infer contextual base in reference to member 'fractionLength'
Cannot infer contextual base in reference to member 'fractionLength'

Time:04-13

I'm trying to follow this enter image description here

CodePudding user response:

maybe things have changed. You could try this instead:

Text(Measurement( value: 47, unit: UnitEnergy.kilocalories)
        .formatted(
            .measurement(
                width: .abbreviated,
                usage: .workout,
                numberFormatStyle: .number.precision(.fractionLength(0))
            )
        )
)
  • Related