Skip to content

Commit 76ad57c

Browse files
committed
Standardize token count abbreviations by switching from lowercase 'k' to uppercase 'K'
1 parent c6a6fb6 commit 76ad57c

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/panel/ContextUtilisation/ContextUtilisation.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const format_tokens = (tokens: number): string => {
1111
return tokens.toString()
1212
}
1313
const k = Math.round(tokens / 1000)
14-
return k.toString() + 'k'
14+
return k.toString() + 'K'
1515
}
1616

1717
export const ContextUtilisation: React.FC<Props> = (props) => {
@@ -39,7 +39,8 @@ export const ContextUtilisation: React.FC<Props> = (props) => {
3939
if (!is_above_threshold) {
4040
const remaining_tokens =
4141
props.context_size_warning_threshold - props.current_context_size
42-
title_text = `${remaining_tokens} tokens remaining until threshold (${formatted_threshold})`
42+
const formatted_remaining_tokens = format_tokens(remaining_tokens)
43+
title_text = `${formatted_remaining_tokens} tokens remaining until threshold`
4344
} else {
4445
title_text = `Context size (${formatted_current_size}) exceeds threshold (${formatted_threshold})`
4546
}

‎packages/vscode/src/context/context-initialization.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const context_initialization = (
8585
)
8686
const formatted_threshold =
8787
threshold >= 1000
88-
? `${Math.round(threshold / 1000)}k`
88+
? `${Math.round(threshold / 1000)}K`
8989
: `${threshold}`
9090
vscode.window.showWarningMessage(
9191
dictionary.warning_message.CONTEXT_SIZE_WARNING(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function display_token_count(token_count: number): string {
22
if (token_count >= 1000) {
3-
return `${Math.floor(token_count / 1000)}k`
3+
return `${Math.floor(token_count / 1000)}K`
44
}
55
return `${token_count}`
66
}

0 commit comments

Comments
 (0)