Skip to content

Add numeric outputs to AnswerUnit#389

Merged
oco777 merged 1 commit intomainfrom
codex/add-float-and-int-outputs-to-answerunit
Nov 25, 2025
Merged

Add numeric outputs to AnswerUnit#389
oco777 merged 1 commit intomainfrom
codex/add-float-and-int-outputs-to-answerunit

Conversation

@oco777
Copy link
Copy Markdown
Owner

@oco777 oco777 commented Nov 25, 2025

Summary

  • add shared answer retrieval logic and reuse it for string, float, and int outputs
  • expose new numeric AnswerUnit ports with float parsing and rounded int conversion while keeping the existing string port
  • document the expanded AnswerUnit outputs in VS_Scratch_Mapping

Testing

  • Not run (not requested)

Codex Task

@oco777 oco777 merged commit e02cdce into main Nov 25, 2025
3 checks passed
@oco777 oco777 deleted the codex/add-float-and-int-outputs-to-answerunit branch November 25, 2025 07:24
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +150 to +154
var text = GetAnswerString(flow) ?? string.Empty;
if (float.TryParse(text, out var value))
{
return value;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid locale-dependent answer numeric parsing

GetAnswerFloat relies on float.TryParse with the current culture, so on locales with comma decimal separators (e.g. de-DE/fr-FR) entering a Scratch-style decimal like 1.5 produces answerFloat/answerInt as 0 and comma input 1,5 is parsed as 1.5 even though Scratch treats comma-separated input as text. Numeric answer ports should parse with culture-invariant rules to keep results consistent with Scratch regardless of OS locale.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant