mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Currency formatting
This commit is contained in:
@ -1775,7 +1775,7 @@
|
|||||||
<option data-i18n="Connect to the API">-- Connect to the API --</option>
|
<option data-i18n="Connect to the API">-- Connect to the API --</option>
|
||||||
</select>
|
</select>
|
||||||
<small>
|
<small>
|
||||||
Max prompt cost: <span id="openrouter_max_prompt_cost">Unknown</span> <span id="openrouter_max_prompt_cost_currency">USD</span>
|
Max prompt cost: <span id="openrouter_max_prompt_cost">Unknown</span>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<h4 data-i18n="OpenRouter API Key">OpenRouter API Key</h4>
|
<h4 data-i18n="OpenRouter API Key">OpenRouter API Key</h4>
|
||||||
|
@ -707,7 +707,7 @@ function calculateOpenRouterCost() {
|
|||||||
const promptTokens = (oai_settings.openai_max_context - completionTokens);
|
const promptTokens = (oai_settings.openai_max_context - completionTokens);
|
||||||
const totalCost = (completionCost * completionTokens) + (promptCost * promptTokens);
|
const totalCost = (completionCost * completionTokens) + (promptCost * promptTokens);
|
||||||
if (!isNaN(totalCost)) {
|
if (!isNaN(totalCost)) {
|
||||||
cost = totalCost.toFixed(3);
|
cost = '$' + totalCost.toFixed(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user