-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASAA-221 - Desktop
- Loading branch information
Showing
5 changed files
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,8 @@ | |
name: Gradle Package | ||
|
||
on: | ||
# push: | ||
# branches: [ "main" ] | ||
# pull_request: | ||
# branches: [ "main" ] | ||
push: | ||
branches: [ "deploy" ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -36,11 +34,13 @@ jobs: | |
with: | ||
arguments: build | ||
|
||
|
||
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in | ||
# the publishing section of your build.gradle | ||
- name: Publish to GitHub Packages | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_PUBLISH_USERNAME: ${{ secrets.REPO_READ_WRITE_USER }} | ||
GH_PUBLISH_PASSWORD: ${{ secrets.REPO_READ_WRITE_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...s/launchpad/compose/util/CurrencyUtils.Launchpad_Compose.kmp-launchpad-compose.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.bottlerocketstudios.launchpad.compose.util | ||
|
||
import java.text.NumberFormat | ||
import java.util.Currency | ||
import java.util.Locale | ||
|
||
/** | ||
* Kotlin Multiplatform function - convertToCurrencyString | ||
* | ||
* This function takes a Double value representing a raw amount of currency, | ||
* and returns a String representing that amount formatted appropriately as | ||
* currency for the current locale of the device running the code. | ||
* | ||
* @param [amount] The raw amount of currency as a Double | ||
* @return A string representing that amount in the appropriate currency | ||
* format for the device's current locale. | ||
*/ | ||
actual fun Double?.toCurrency(): String { | ||
val numberFormat = NumberFormat.getCurrencyInstance() | ||
numberFormat.currency = Currency.getInstance(Locale.getDefault()) | ||
return numberFormat.format(this ?: 0.0) | ||
} |