Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Conversation

@Fresheyeball
Copy link

No description provided.

@paf31
Copy link
Contributor

paf31 commented Oct 31, 2014

Ok, I'm going to be super picky here :)

Can we reorder the function arguments? From a partial application viewpoint, it seems more likely that you'd want to partially apply to the number of decimal places:

printThree x y z = 
  formatDecimal x ++ ", " 
  formatDecimal y ++ ", " 
  formatDecimal z
  where
  formatDecimal = toFixed 2

@Fresheyeball
Copy link
Author

I'm pretty sure that's the current order of the arguments

@paf31
Copy link
Contributor

paf31 commented Oct 31, 2014

Oh. I was confused because of the argument names. I assumed decimal meant "the decimal I'm formatting". Sorry :)

@paf31
Copy link
Contributor

paf31 commented Oct 31, 2014

Looks good to me. @garyb any comments?

@garyb
Copy link
Member

garyb commented Oct 31, 2014

I'm not sure why, but we had toFixed once before, and then removed it: 00d2191. I'll have a think about why before re-merging.

@garyb
Copy link
Member

garyb commented Nov 16, 2014

Sorry, forgot to get back to this... the problem is toFixed throws runtime exceptions if you call it with an argument < 0 or > 20, so ideally we should be using Eff or something to represent/handle that situation.

@Fresheyeball
Copy link
Author

Actually, it sounds like having toFixed is the wrong approach for PureScript then. It might be better to put up some functions that round to a set number of decimals than use this JavaScript native method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants