Sorting number with comma in react-bootstrap-table2











up vote
0
down vote

favorite












Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?



example
enter image description here



Cheers!










share|improve this question
























  • What are you trying to do exactly? Sort the columns?
    – seanulus
    Nov 9 at 17:42










  • can you share your code?
    – Tall Paul
    Nov 9 at 18:20










  • yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
    – Gearóid
    Nov 12 at 10:23

















up vote
0
down vote

favorite












Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?



example
enter image description here



Cheers!










share|improve this question
























  • What are you trying to do exactly? Sort the columns?
    – seanulus
    Nov 9 at 17:42










  • can you share your code?
    – Tall Paul
    Nov 9 at 18:20










  • yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
    – Gearóid
    Nov 12 at 10:23















up vote
0
down vote

favorite









up vote
0
down vote

favorite











Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?



example
enter image description here



Cheers!










share|improve this question















Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?



example
enter image description here



Cheers!







reactjs react-bootstrap-table






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 17:25

























asked Nov 9 at 17:06









Gearóid

3416




3416












  • What are you trying to do exactly? Sort the columns?
    – seanulus
    Nov 9 at 17:42










  • can you share your code?
    – Tall Paul
    Nov 9 at 18:20










  • yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
    – Gearóid
    Nov 12 at 10:23




















  • What are you trying to do exactly? Sort the columns?
    – seanulus
    Nov 9 at 17:42










  • can you share your code?
    – Tall Paul
    Nov 9 at 18:20










  • yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
    – Gearóid
    Nov 12 at 10:23


















What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42




What are you trying to do exactly? Sort the columns?
– seanulus
Nov 9 at 17:42












can you share your code?
– Tall Paul
Nov 9 at 18:20




can you share your code?
– Tall Paul
Nov 9 at 18:20












yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23






yeah, I'm trying to sort the columns. When it's converted to a string to achieve the comma it doesn't work. I was hoping there was a simple solution built into the plugin react-bootstrap-table.
– Gearóid
Nov 12 at 10:23














1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.






share|improve this answer





















  • Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
    – Gearóid
    Nov 12 at 10:20










  • I used this solution I found in another question jsfiddle.net/EuQTX/1
    – Gearóid
    Nov 12 at 11:50











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230331%2fsorting-number-with-comma-in-react-bootstrap-table2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.






share|improve this answer





















  • Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
    – Gearóid
    Nov 12 at 10:20










  • I used this solution I found in another question jsfiddle.net/EuQTX/1
    – Gearóid
    Nov 12 at 11:50















up vote
1
down vote



accepted










Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.






share|improve this answer





















  • Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
    – Gearóid
    Nov 12 at 10:20










  • I used this solution I found in another question jsfiddle.net/EuQTX/1
    – Gearóid
    Nov 12 at 11:50













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.






share|improve this answer












Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 9 at 20:18









mediaguru

499513




499513












  • Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
    – Gearóid
    Nov 12 at 10:20










  • I used this solution I found in another question jsfiddle.net/EuQTX/1
    – Gearóid
    Nov 12 at 11:50


















  • Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
    – Gearóid
    Nov 12 at 10:20










  • I used this solution I found in another question jsfiddle.net/EuQTX/1
    – Gearóid
    Nov 12 at 11:50
















Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20




Thanks, Yeah that makes sense. I was hoping the react-bootstrap-table plugin would have a setting that takes care this.
– Gearóid
Nov 12 at 10:20












I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50




I used this solution I found in another question jsfiddle.net/EuQTX/1
– Gearóid
Nov 12 at 11:50


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230331%2fsorting-number-with-comma-in-react-bootstrap-table2%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

National Museum of Racing and Hall of Fame

Guess what letter conforming each word