GithubHelp home page GithubHelp logo

Comments (4)

pavankataria avatar pavankataria commented on May 13, 2024

I'm not sure I understand. What is the connection between the didTapColumn and formatting numbers? You should be able to format the numbers as you please and then insert that into the Data object as a string.

For example

numberFormatter.style = .currency
numberFormatter.locale = "en_GB"
let number = NSDecimalNumber(decimal: 1234344.44)
numberFormatter.string(from: number)

from swiftdatatables.

cgarcia55 avatar cgarcia55 commented on May 13, 2024

An apology if I did not explain myself well, I have already formatted the data, the detail is that if I press the header of any of the columns, the sort that gives me is incorrect because the value of the data is not double, rather its a string ( or so I think that is the reason), since it does not give me a completely correct ascending arrangement neither descending one .
I attach an image.

table

That is why I tried to catch the click on the header (assuming it was the didtapColumn) and this be able to do the sort by myself.

I hope I explained myself well.
Thanks in advance and greetings.

from swiftdatatables.

pavankataria avatar pavankataria commented on May 13, 2024

Okay, that's a problem. Thank you for writing such a detailed and helpful response.
What we need is a custom sort allowing you to define the sort order for specific columns.

I will want to work on this as soon as possible. Can you tell me how you would want to define the sorting behavior yourself?

from swiftdatatables.

cgarcia55 avatar cgarcia55 commented on May 13, 2024

I had the idea of managing a kind of absolute value by converting the currency value to double, in order to make a normal ascending arrangement.
That was why my question, if it was possible to intercept the click in the header. to sort from the arrangement that fills the table.

from swiftdatatables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.