FVector Rounding
In pursuit of developing an in-built grid system (RTS strikes again), some basic maths functions were required in/around FVector for convenience's sake - specifically the pursuit of get the nearest grid point to X location. We've got to navigate the int to float conversions here, hence the LIBERAL application of static_cast. We could do a straight up cstyle cast here, but with a static_cast we get the compile time validation. THE TYPE COOERCION IS OPTIONAL The compiler will give us a bit of a nudge when doing int->float conversions because of the potential data loss - understandable. Im trying to keep the compile gods happy so im not going to ask it to do the legwork itself. Add the following function definitions -
UnrealMathUtility.h - CHANGE
       
//start @AirEngine FVector rounding functions
static CORE_API int32 RoundIntToNearest(const int32 InInt, const uint32 InNearestFactor);
static CORE_API FVector RoundVectorToNearestInt(const FVector& InVector, const uint32 InNearestFactor);
//end @AirEngine FVector rounding functions
UnrealMath.cpp - CHANGE

//start @AirEngine FVector rounding functions
int32 FMath::RoundIntToNearest(const int32 InInt, const uint32 InNearestFactor)
{
    const int32 CurrVal = FMath::Abs(InInt);
    const int32 Diff = FMath::Abs(CurrVal % (int32)InNearestFactor);
    
    const int32 UnsignedVal = (Diff < InNearestFactor * 0.5f) ? (CurrVal - Diff) : (CurrVal + (InNearestFactor - Diff));
    return UnsignedVal * FMath::Sign(InInt);
}

FVector RoundVectorToNearestInt(const FVector& InVector, const uint32 InNearestFactor)
{
    //Coorce into float at each step - FVector consists of floats but we're rounding to ints
    return FVector(
    static_cast<float>(RoundIntToNearest(static_cast<int>(InVector.X), InNearestFactor)),
    static_cast<float>(RoundIntToNearest(static_cast<int>(InVector.Y), InNearestFactor)),
    static_cast<float>(RoundIntToNearest(static_cast<int>(InVector.Z), InNearestFactor)));
}
//end @AirEngine FVector rounding functions
Ok, so whats our usecase here? Given Location FVector(110.f, -110.f, 90.f) with a Grid Size of 100, FMath::RoundVectorToNearestInt(Location, 100.f) would return FVector(100.f, -100.f, 100.f) as that would be the nearest grid point. We're also making sure to add our functions to our the CORE API - so, fair warning, this compile's a biggie.