Currency formatting
This commit is contained in:
parent
aa49efe656
commit
c6b18de4ef
|
@ -1775,7 +1775,7 @@
|
|||
<option data-i18n="Connect to the API">-- Connect to the API --</option>
|
||||
</select>
|
||||
<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>
|
||||
</div>
|
||||
<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 totalCost = (completionCost * completionTokens) + (promptCost * promptTokens);
|
||||
if (!isNaN(totalCost)) {
|
||||
cost = totalCost.toFixed(3);
|
||||
cost = '$' + totalCost.toFixed(3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue