Hello. In CoreData, the settings attribute stores a float value. How to use it for calculation? Here is the code to calculate:

///tMoney.settings это атрибут в сущности let mFWork = Float(((diffHour * 60 + diffMinute - breek) * tMoney.settings/60) - (((diffHour * 60 + diffMinute - breek) * tMoney.settings/60) * 13 / 100)) 

Xcode swears: Expression was complex to be solved in reasonable time; consider breaking up expressions

    1 answer 1

    In short, xcode does not cope with indexing this line. There are a lot of mathematical operations in it, and in fact for each it needs to check potential overloads.

    I suggest you rewrite the whole thing, like this:

     let time = Float(diffHour * 60 + diffMinute - breek) let cash = Float(time * tMoney.settings/60) let mFWork = Float(cash - cash * 0.13) 
    • Now swears at let temp. Similar. - Metman
    • crush on. I'll fix the answer now - Max Mikheyenko
    • Thank. Works:). - Metman