Currency formatting

This commit is contained in:
Cohee
2023-08-10 13:01:55 +03:00
parent aa49efe656
commit c6b18de4ef
2 changed files with 2 additions and 2 deletions

View File

@ -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>

View File

@ -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);
} }
} }