https://kotlinlang.org
Join Slack
I'm trying to convert a long amount in euro cents to a readable value. I'm not European and I see c...
c

Colton Idle

almost 4 years ago
I'm trying to convert a long amount in euro cents to a readable value. I'm not European and I see conflicting information on this. Here is my ext func
fun Long.euroCentsToString(): String {
    val format = NumberFormat.getCurrencyInstance()
    format.maximumFractionDigits = 2
    format.currency = Currency.getInstance("EUR")

    return format.format(this/100)
}
If I call
849999L.euroCentsToString()
I get a result of
€8,499.00
I thought what I'd get is
€8.499,99
So Basically three issues: 1. I thought europeans use
.
to separate thousands from hundreds 2. I thought europeans use
,
to designate the start of fractional (cents) 3. I thought I'd see 99 as the cents and not 00.
c
t
e
  • 3
  • 37
  • 1020
How can i convert base64 to bitmap in compose multiplatform? whats the alternative of `android.graph...
s

Shoaib khalid

about 2 years ago
How can i convert base64 to bitmap in compose multiplatform? whats the alternative of
android.graphics.BitmapFactory
?
s
m
  • 2
  • 7
  • 1019
Does exist something similar to "Toast" for displaying simple notifications or bubbles to the user i...
p

Pablo

almost 3 years ago
Does exist something similar to "Toast" for displaying simple notifications or bubbles to the user in Compose Desktop?
p
h
t
  • 3
  • 6
  • 1019
What is the recommended way for validations in ktor? I have always used `javax.validation`and it is ...
h

Henrik Johansson

over 2 years ago
What is the recommended way for validations in ktor? I have always used `javax.validation`and it is very easy and gets out of your way even if the annotations look a bit ugly. Writing validation functions for each and every requests field seems very messy. Is that really how we want to do it? Why not stick with annotations and the validation plugin use them much like
javax.validation
. That way the restrictions on the request type stays very close to the type and it becomes very little code.
h
a
+2
  • 4
  • 9
  • 1016
Any way to display a GIF in compose multiplatform? coil-gif was good for android but apparently it ...
r

Raed Ghazal

almost 2 years ago
Any way to display a GIF in compose multiplatform? coil-gif was good for android but apparently it doesn’t support KMP
r
j
k
  • 3
  • 17
  • 1015
How can I apply BlendMode to composable? I know how to add it using canvas, but I want to apply it o...
p

Piotr Prus

over 2 years ago
How can I apply BlendMode to composable? I know how to add it using canvas, but I want to apply it on composable. I am playing around with shaders and I do not want to add BlendMode
color_dodge
to blend this shader: https://www.shadertoy.com/view/MdjfRK into transparent background version. I want the blaks to disappear, but do not loose the details of color noise.
p
r
t
  • 3
  • 26
  • 1014
How can I set a preview placeholder for a Coil image? It lacks an alternative to `tools:src`. The Ac...
m

Marcin Wisniowski

almost 4 years ago
How can I set a preview placeholder for a Coil image? It lacks an alternative to
tools:src
. The Accompanist version had a
previewPlaceholder
. But after Compose support moved to the Coil library proper, it was removed. Are there any solutions?
m
s
  • 2
  • 8
  • 1013
how can I get the view of the current composable only ? I tried LocalView.current but it gets the wh...
l

Louis

over 2 years ago
how can I get the view of the current composable only ? I tried LocalView.current but it gets the whole screen.
l
a
+5
  • 7
  • 22
  • 1011
In order to get rid of ```Warning: Kotest autoscan is enabled. This means Kotest will scan the class...
s

Sebastian Schuberth

about 2 years ago
In order to get rid of
Warning: Kotest autoscan is enabled. This means Kotest will scan the classpath for extensions that are annotated with @AutoScan. To avoid this startup cost, set autoscan to false by setting the system property 'kotest.framework.classpath.scanning.config.disable=true'. For further details see <https://kotest.io/docs/next/framework/project-config.html#runtime-detection>
I'm setting
tasks.withType<Test>().configureEach {
    systemProperties = mapOf(
        "kotest.framework.classpath.scanning.config.disable" to "true"
    )
}
in my Gradle build file, but I'm still seeing the message.Am I correct to assume that this should work?
s
a
  • 2
  • 4
  • 1010
Hi all, in navigation 2.6.0-alpha navController.backQueue is private so and I want to know navigatio...
z

Zaki Shaikh

over 2 years ago
Hi all, in navigation 2.6.0-alpha navController.backQueue is private so and I want to know navigation history how can I do?
☝️ 2
z
c
+3
  • 5
  • 8
  • 1010
Previous454647Next

kotlinlang

A modern programming language that makes developers happier.

Powered by