Hans Raaf

Results 419 comments of Hans Raaf

You can write tests (see go-app test sources). You can actually debug in the browser, but that is not expressive, but I think they work in it. But currently you...

> Could you please make an example of using app.Log() or dbg.Log() ? I would `go get github.com/metatexx/go-app-pkgs/dbg` and then import it and use `dbg.Logf("name: %q", "oderwat")` which will output...

> Also PreRender can be useful for debugging? We actually never use `PreRender()` at all. Because of the code separation of WASM and server code there is not even any...

For debugging the actual WASM I found some good information here: https://www.youtube.com/watch?v=DcEcRfauvuw https://github.com/WebAssembly/wabt

> Mhh, `OnInit()` is a thing? I don't see it being referenced there: https://go-app.dev/components#lifecycle-events I think that whole diagram is a bit outdated or does not contain the information that...

This may help to resolve the problem: https://go.dev/play/p/HP82b8ZX_Zp `trunc()` is defective: `trunc(new(big.Rat).SetFloat64(0.00015), 5)` returns "14/100000" which is not right, is it?

OK. Forget it :) ... I just found that the real problem here is how I initialize the variable! `fmt.Println(trunc(big.NewRat(15, 100000), 5))` does return "15/100000". I guess my Round routine...

Actually. Maybe it is a bug because it should also round `5534023222112865/36893488147419103232` correctly?

Yes. Your package works correct but that is the problem with float64 origins. Because we all expect it to be not correct. So Rounding `new(big.Int).SetString("0.00015")` probably should be aware of...

What I mean is that if you have a periodic '9'er non-rational input number, you may want to round it before truncating: 0,00015*10000=1,4999999999999999 = trunc(1) = 1,4 ... but is...