Re: floating point output formating

2017-11-09 Thread Udiknedormin
@Araq I probably mistook the general spirit of your answer for an answer to this particular thing. Sorry then. Well, I'm puzzled about this particular case (searching for float formating) too, as... well, I've already said this --- if you're looking for a single specific function (which is,

Re: floating point output formating

2017-11-08 Thread Araq
> It seems Araq doesn't really like my way of thinking. I can also see how Araq > reacted to pointing out formatFloat's odd behaviour for 0 (which was quite > odd to me, too). I, for instance, didn't notice it myself as I don't really > use Nim for numerical calculations (I use Fortran). And I

Re: floating point output formating

2017-11-08 Thread Udiknedormin
@dom96 > Doc writing is boring > > Creating documentation PRs is the easiest thing in the world (but also the > most boring) It depends. I, for instance, quite like it. I care (although "deeply" may be a big word) about my users so even if I have no time, energy or I'd like to move to

Re: floating point output formating

2017-11-08 Thread mratsim
>From a formatting point of view, please don't use the `code` syntax for bold, >it's painful to read. I think it's completely misplaced to criticize dom96 for not contributing to documentation, he took two years of his time to write an excellent book, make sure that his examples are useful and

Re: floating point output formating

2017-11-08 Thread jzakiya
@dom96 if you want people to voluntarily, out of their concern for the project, and goodness of their own `heart`, contribute to Nim, first you need to `check your attitude`, and learn how not to chase people away.

Re: floating point output formating

2017-11-07 Thread Araq
> Would it be difficult to enamble doc tool to handle expanded macros? I love > generating docs in Rust's macros so I thought it would be really nice when > you have repetitive routines as I could use a macro and the user still have > nice docs for each routine independently. `nim doc2` does

Re: floating point output formating

2017-11-07 Thread dom96
@jzakiya I have read a lot in this post, but due to my own lack of time I decided to skip most of it (so apologies if somebody mentioned this already). Why doesn't Nim have better docs? Some reasons: * Nim doesn't have full-time employees working on it (this is also why telling us "you

Re: floating point output formating

2017-11-07 Thread Udiknedormin
Well, it certainly helps a lot when you find some code which uses some cool routines you know nothing about. It helped me with pegs that way if I recall. Although I must admit that I've already assumed it was something similar to regexes as ~= was used and Perl also uses it.

Re: floating point output formating

2017-11-07 Thread sky_khan
"the index" is good to have but it is helpful **only** if you already know what you're searching for. Otherwise if you dont have any clue about what you are searching, **how** certain things are done in Nim, It is only a huge pile of unorganized identifiers. BTW, could anyone direct me to how

Re: floating point output formating

2017-11-07 Thread Udiknedormin
Wow, I see most of you guys don't like the index & library list as much as I do. They're not bad, in my opinion. @bluenote Dependency avoidance... Well... It wouldn't be a real problem if dependencies were solved automagically (see: Rust). ^^" Btw. that's a hell of a nasty line you quoted!

Re: floating point output formating

2017-11-07 Thread jzakiya
**Araq you need to chill out!** I took the time to document for you unexpected, deficient, and incorrect behavior of your documentation and you are not even `humble` enough to thank me for it. So why should I bother to keep using your `work in progress` language that you can't even take

Re: floating point output formating

2017-11-07 Thread Araq
How much more will be revealed once you know about [https://play.nim-lang.org/?gist=3e9b43b91d956366d8e5ff1a13e1efc6](https://play.nim-lang.org/?gist=3e9b43b91d956366d8e5ff1a13e1efc6) Btw thanks for never answering my questions.

Re: floating point output formating

2017-11-07 Thread jzakiya
Upon thinking about it, I think the case for `echo num.formatFloat(ffDecimial, 0)` is incorrect, and should be changed to be consistent with the intent of the function. The `0` option should produce a value (currently it would be `rounded`) with no digits displayed. `echo

Re: floating point output formating

2017-11-07 Thread jzakiya
@bluenote, also for `formatFloat`, it should also explain that it seems to using `rounding` of the digits its displays and not truncation. If a user wants to just truncate the displayed digits what function does that, or can this one perform that too. It may be an option to include into this

Re: floating point output formating

2017-11-07 Thread jzakiya
@bluenote I could kiss you! Now just do that for at least everything in that module and that will be a significant start, and benefit to all of us users.

Re: floating point output formating

2017-11-07 Thread bluenote
@jzakiya: Do you think that is helpful: [https://github.com/nim-lang/Nim/pull/6704](https://github.com/nim-lang/Nim/pull/6704)

Re: floating point output formating

2017-11-07 Thread jzakiya
Hey guys, stop being defensive. If I didn't think Nim is a worthy project, and has great potential, I would have never bothered to take the time to tell you how to improve your project, and it would be in your interest to take comments as mine as `positive critical feedback`. As further

Re: floating point output formating

2017-11-06 Thread mratsim
@jzakiya, you are right that Nim documentation could be improved. Especially theindex could be made more visible, like a link "Looking for a proc? Try theindex" on the website or the manual. If it exists it's probably not visible enough. Then, Nim has 2 core devs, and no one full-time on it.

Re: floating point output formating

2017-11-06 Thread woggioni
Jzakiya, you are absolutely right when you say > the only limits of what you can provide in documentation are self imposed and I also agree that, in general, there is a lot of space to improve nim documentation since there are lots of parts that are undocumented in practice (or at least assume

Re: floating point output formating

2017-11-06 Thread mikra
Hi all, my humble 2ct to the docu topic: it took me also 1hr to find out what a Slice is and how it`s constructed and especially whats the difference between Slice and range (I think range is compiler built in). One example would be very nice. @jzakiya you can also use printf native in Nim (I

Re: floating point output formating

2017-11-06 Thread bluenote
@Udiknedormin I strongly think it should be part of the language. Developers fear dependencies[*], so people will continue to use workarounds instead of using string interpolation via an external dependency. Also, the Nim core itself could benefit from it in some places ([random

Re: floating point output formating

2017-11-06 Thread Araq
I will just quote myself again: > At this point you need to be able to read Nim's type signatures. More > examples for this proc would be nice indeed (!!!) but I don't see how they > would have helped you in finding the proc in the first place. There were some hidden questions for you, you

Re: floating point output formating

2017-11-06 Thread jzakiya
Actually, `the only limits of what you can provide in documentation are self imposed`. `Writing documentation is an attitude!` Either you care about doing it (to benefit/help users) or you don't. Nim has to compete against lots of other languages, and like cars, smartphones, etc, having the

Re: floating point output formating

2017-11-06 Thread Araq
> The Docs really need to get better by showing clear examples like this for > just about everything. It took way too long for me to search and not even > find this, and had to resort to asking how to do this here. When I go to

Re: floating point output formating

2017-11-06 Thread Udiknedormin
@bluenote Correct me if I'm wrong but wasn't string interpolation ("borrowed" from Swift) already done long time ago? Can't it stay library-provided? It's not like every language has it in the core.

Re: floating point output formating

2017-11-05 Thread jlp765
RFC: if strutils has `toBin()`, `toHex()`, `toOctal()`, `intToStr()` and from system.nim, the `$` operator is described as `The stringify operator for an integer argument. Returns x converted to a decimal string. $ is Nim's general way of spelling toString.` why not add a helper proc to

Re: floating point output formating

2017-11-05 Thread jzakiya
Thanks a whole lot! The Docs really need to get better by showing clear examples like this for just about everything. It took way too long for me to search and not even find this, and had to resort to asking how to do this here. I also agree the semantics for doing this has to become a lot

Re: floating point output formating

2017-11-05 Thread bluenote
import strutils let num = 10.123456789 echo num.formatFloat(ffDecimal, 4)

Re: floating point output formating

2017-11-05 Thread jzakiya
let num = 10.123456789 echo( formatFloat(num) ) Could I get a little help here to make this work.

Re: floating point output formating

2017-11-05 Thread bluenote
And hopefully we will soon have string interpolation in Nim ([PR](https://github.com/nim-lang/Nim/pull/6507)). Then it would be something like this (or similar, language is still in discussion): echo "$x%.4f"

Re: floating point output formating

2017-11-05 Thread woggioni
read [here](https://nim-lang.org/docs/strutils.html#formatFloat,float,FloatFormatMode,range\[\],Char)

floating point output formating

2017-11-05 Thread jzakiya
I compute a floating point number `x`. How do I use `echo|write.stdout` to output it with just 4 decimal digits showing?