Skip to content

Adding some missing converters #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Adding some missing converters #958

merged 6 commits into from
Nov 26, 2024

Conversation

Jolanrensen
Copy link
Collaborator

@Jolanrensen Jolanrensen commented Nov 19, 2024

Fixes #894 and updates some of the convert docs.

Added missing conversions:

  • from Number
    • to BigInteger
    • to BigDecimal
  • from Boolean
    • to BigInteger
  • from Char
    • to Int (by code)
  • from Int
    • to Char (by code)
    • to BigInteger
  • from Byte
    • to Double, Float, Int, Short, Long, BigDecimal, BigInteger, Boolean, LocalDateTime, LocalTime, Instant (and java overloads), similar to Int
  • from Short
    • to all of those as well
  • from Double
    • to Byte
    • to BigInteger
  • from Long
    • to BigInteger
    • to LocalTime (kotlinx was missing)
  • from Float
    • to Byte
    • to BigInteger
  • from BigDecimal
    • to Byte
    • to Short
    • to BigInteger
  • from BigInteger
    • to Double, Int, Byte, Short, Float, Long, BigDecimal, Boolean
  • from LocalTime (kotlinx)
    • to LocalTime (java) (fixes issue)
  • from LocalTime (java)
    • to LocalTime (kotlinx) (fixes issue)

Added extra conversion tests

@Jolanrensen Jolanrensen force-pushed the local-time-converters branch from ea75149 to 32198f2 Compare November 21, 2024 15:14
@Jolanrensen Jolanrensen added this to the 0.15.0 milestone Nov 22, 2024
@Jolanrensen Jolanrensen marked this pull request as ready for review November 25, 2024 13:35
@@ -76,3 +80,21 @@ dataFrameOf("direction")("NORTH", "WEST")

<dataFrame src="org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToEnum.html"/>
<!---END-->

And finally, [Value classes](https://kotlinlang.org/docs/inline-classes.html) can be created
and unpacked using `convert`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small note, what do you mean "unpacked"? One can convert IntClass to let's say Double?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rewrite to clarify it a bit. Yes, you can convert IntClass to Double and back :). Didn't know this before

Copy link
Collaborator

@koperagen koperagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Jolanrensen Jolanrensen merged commit 510680c into master Nov 26, 2024
4 checks passed
@Jolanrensen Jolanrensen deleted the local-time-converters branch November 26, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing LocalTime converters
2 participants