gpt4 book ai didi

swift - 向现有的 apple 转换类添加更多转换单位

转载 作者:行者123 更新时间:2023-11-28 11:26:14 26 4
gpt4 key购买 nike

<分区>

是否可以向现有的 apple 转换类添加更多转换单元?

https://developer.apple.com/documentation/foundation/unittemperature在上面的链接中,Rankine 不可用。如何自定义/扩展这个类并添加 Rankine?

附言。朗肯样本公式为:5°C × 9/5 + 491.67 = 500.67°R

PPS。打算这样用

let celsius = Measurement(value: 4, unit: UnitTemperature.celsius)
let kelvins = celsius.converted(to: UnitTemperature.kelvin)
print(kelvins)

TIA

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com