forked from EvergreenCrypto/docker-finance
container: finance: fetch: prices: format non-alpha currencies
Formats non-alpha character currencies for hledger's prices journal (e.g., "1INCH", "USDC.e", etc.)
This commit is contained in:
@@ -292,6 +292,11 @@ namespace docker_finance\prices\internal
|
||||
$stack = []; // Final journal entries
|
||||
$average = 0; // Purely for printing
|
||||
|
||||
# Format non-alpha character currencies for hledger (e.g., "1INCH", "USDC.e", etc.)
|
||||
if (!ctype_alpha($ticker)) {
|
||||
$ticker = "\"".$ticker."\"";
|
||||
}
|
||||
|
||||
foreach ($prices as $date => $price) {
|
||||
|
||||
// Price journal entry line
|
||||
|
||||
Reference in New Issue
Block a user