Files
TheracUE/Source/MyProject/Private/MagicFloatInput.cpp

17 lines
477 B
C++
Raw Normal View History

// Fill out your copyright notice in the Description page of Project Settings.
#include "MagicFloatInput.h"
2025-05-09 16:02:07 +01:00
void UMagicFloatInput::HandleOnTextCommitted(
FText const & inText,
ETextCommit::Type inCommitMethod
) {
if (inText.IsEmptyOrWhitespace()) {
if (sourceInput != nullptr) {
SetText(sourceInput->GetText());
} else {
auto x = FCString::Atof(*inText.ToString());
SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
2025-05-09 15:32:49 +01:00
}
2025-05-09 16:02:07 +01:00
}
2025-05-09 15:32:49 +01:00
}