Log message #4189887

# At Username Text
# Jun 18th 2019, 09:31 neon1024 number_format doesn’t return a string :thinking_face:
# Jun 18th 2019, 09:30 martin I don’t like parsing te float as a string and then calculating with it?
# Jun 18th 2019, 09:29 martin returns long float
# Jun 18th 2019, 09:29 martin $test = 3.95; echo json_encode($test);exit;
# Jun 18th 2019, 09:28 neon1024 @martin Have you trierd using `number_format()` in an entity accessor method?
# Jun 18th 2019, 09:26 martin when I do echo json_decode($array) I get the long float
# Jun 18th 2019, 09:26 conehead What does the debugger say?
# Jun 18th 2019, 09:25 conehead So pr the array you get 3.95 and when returning the result you get an incorrect value?
# Jun 18th 2019, 09:23 martin when I pr the array I just get a nice 3.95 :P
# Jun 18th 2019, 09:22 conehead Martin, can you store it as int (multiplied by 100) and divide by 100 in the last step?
# Jun 18th 2019, 09:21 challgren He is the plugin king!
# Jun 18th 2019, 09:20 martin hmm rounding it in entity does not work, I still get a long float :S
# Jun 18th 2019, 09:19 challgren I’m surprised dereuromark hasn’t come up with a plugin for both yet :P
# Jun 18th 2019, 09:18 challgren I haven’t fully vested into it yet but its been the best one for my use case. Ive been stuck in Kotlin for the past month so havent had time to implement it yet
# Jun 18th 2019, 09:17 conehead @challgren do you save associated data as well? might switch to the audit logging you mentioned
# Jun 18th 2019, 09:15 conehead Well that plugin only stores the changed fields and does not store the whole entity
# Jun 18th 2019, 09:12 neon1024 I need to do both actually, but I’m going to tackle the logging first as it’s a bit simpler
# Jun 18th 2019, 09:11 challgren My use requires rollbacks so thats why I went version than audit log
# Jun 18th 2019, 09:10 challgren Ahh ok
# Jun 18th 2019, 09:10 neon1024 @challgren They would have an overlap in a venn diagram, but logging keeps a log of what has happened, and versioning would store the whole thing
# Jun 18th 2019, 09:08 Martin` But what is a good way to handle the long float? rounding in entity to 2 decimals?
# Jun 18th 2019, 09:06 challgren Isn’t audit logging pretty much the same as versioning?
# Jun 18th 2019, 09:01 neon1024 I don’t need versioning though :thinking_face:
# Jun 18th 2019, 08:57 challgren @neon1024 Ive been messing with https://github.com/josegonzalez/cakephp-version
# Jun 18th 2019, 08:57 conehead @neon1024 Currently doing the same. https://github.com/lorenzo/audit-stash Looks quite promising, but somehow associated data does not work for me
# Jun 18th 2019, 08:57 martin client side I mean local :P
# Jun 18th 2019, 08:56 martin yes I’m also thinking that, testing it client side. But I’m not calculating any things with it. why do I still have problems with printing it?
# Jun 18th 2019, 08:56 martin I’m switching between irc and slack. :P
# Jun 18th 2019, 08:56 neon1024 Hey everyone! I have a ticket to add audit logging, any tooling or good solutions already out there that I should look at?
# Jun 18th 2019, 08:55 challgren @conehead is headed down the correct rabbit hole
# Jun 18th 2019, 08:54 Martin` 64bit
# Jun 18th 2019, 08:54 conehead https://www.leaseweb.com/labs/2013/06/the-php-floating-point-precision-is-wrong-by-default/
# Jun 18th 2019, 08:53 challgren Are you running on 64bit or 32bit?
# Jun 18th 2019, 08:53 challgren Does it happen with FLOATs?
# Jun 18th 2019, 08:53 martin I think it has to do with a float indeed, I was hoping that chancing to a float 8,2 would fix that but that does not help
# Jun 18th 2019, 08:51 martin I’m just using the default json render thing that is used by crud, do noting specials :slightly_smiling_face:
# Jun 18th 2019, 08:51 challgren “17763568394002504646778106689453125”
# Jun 18th 2019, 08:51 challgren the weird data comes back in this web page
# Jun 18th 2019, 08:51 challgren https://www.exploringbinary.com/using-integers-to-check-a-floating-point-approximation/
# Jun 18th 2019, 08:50 Martin` 1994
# Jun 18th 2019, 08:50 Martin` ehh