我已经为Yoast SEO安装了带有ACF Content Analysis的Yoast SEO。
但是,这并未将ACF文本计入单词数中。我不确定自己在做什么错,我正在调查private func splitTransaction(amount: Money<GBP>, with friends: [String]) -> [String: SplitTransactionAmount] {
//First we remove any duplicate names.
let uniqueFriends = friends.removingDuplicates()
//Create an empty dictionary to hold the new values before returning.
var newSplitTransaction = [String: SplitTransactionAmount]()
let totalAmountToSplitRounded = amount.rounded.amount
let numberOfSplitters = uniqueFriends.count
let eachTotalRaw = totalAmountToSplitRounded / Decimal(numberOfSplitters)
let eachTotalRounded = Money<GBP>(eachTotalRaw).rounded.amount
let remainder = totalAmountToSplitRounded - (Decimal(numberOfSplitters) * eachTotalRounded)
if remainder == 0 {
//If the amount to split each goes in to the total with no remainder, everyone pays the same.
for friend in uniqueFriends {
newSplitTransaction[friend] = SplitTransactionAmount(amount: Money(eachTotalRounded), setByUser: false)
}
} else {
for friend in uniqueFriends {
if friend == uniqueFriends.first! {
//Unlucky first friend has to pay a few pence more!
newSplitTransaction[friend] = SplitTransactionAmount(amount: Money(eachTotalRounded + remainder), setByUser: false)
} else {
newSplitTransaction[friend] = SplitTransactionAmount(amount: Money(eachTotalRounded), setByUser: false)
}
}
}
return newSplitTransaction
}