-3

For example, in this post:

What is the best way to put commas into large numbers

both answers are right, but slightly different.

  • 1
    NB, You accept an answer. Tagging means something else on StackExchange. – Colin 't Hart Sep 7 '18 at 13:59
3

From the Help Center (emphasis added):

What does it mean when an answer is "accepted"?

[…]

Accepting an answer is not meant to be a definitive and final statement indicating that the question has now been answered perfectly. It simply means that the author received an answer that worked for them personally.

Understandably, both suggestions can work for you but at the same time your real code is likely going to use either one or the other. Therefore, if you want to accept an answer based on the guidelines, accept the one that you have actually decided to adopt (for this specific problem, anyway).

3

This is answered in the Help Center:

  • Choose one answer that you believe is the best solution to your problem.
3

The idea of accepting multiple answers has been suggested multiple times on meta.SE, and always declined or found lacking community support. Nevertheless, there is some very useful guidance on resolving the underlying issue.

For example, in Which answer do I accept if I have multiple correct answers? the top-scored answer by Bill the Lizard says:

If the answers are different, but all correct, I would upvote all of the correct answers, and accept the one that I actually use.

If the answers are all the same, but came in at different times, I would accept the one that came in first, unless one answer was more clear or went into greater detail.

Another way of looking at the tie-breaker is to ask oneself: Which answer was most helpful to me overall?

Another point of view is provided by the accepted answer by John Rash on A way to accept more than one answer would be useful:

Technically this already exists, the answer accepted by the original poster, and the answer accepted by the community (i.e. the one with the highest votes).

In your case, you have accepted one answer, and the community has given more upvotes to the other (at the time of writing this).


Note though that the highest voted answer by Sampson on the same question says (with my grammar improvement):

Having more than one accepted-answer can be confusing.

If two or more answers are acceptable, they should probably be adapted into one single answer, and then that one should be accepted.

Now that suggestion doesn't really apply to your question (since both answers are essentially the same) but in other cases it might.

To spell it out, since some people might find it counterintuitive, the idea is to create a single best answer. As Shog9 says:

The goal isn't to have multiple answers each containing a piece of the puzzle. It's to have a single, correct, comprehensive answer.

He elaborates on that in answer to the linked Q & A Why Isn't There a Way to Consolidate Answers?:

The Stack Overflow Method of consolidating answers

  1. Pick an answer, any answer.
  2. Extract portions of other answers that augment the answer chosen in #1, and edit those portions into said answer. Cite and link to the answers extracted from, where appropriate.
  3. (optional, question owner only) Accept the (now-comprehensive) answer chosen in #1.
  4. (optional, if you're lazy) Upvote all helpful answers, post comments thanking the respective authors for their contributions.
2

I think that although both answers are correct, you should choose one of them as the best answer.

Obviously, if you are the original poster, you can point it out in comments or by editing the answer, and add a comment about the second one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .