# How to serialize with two decimal places using FMemoryWriter & FMemoryReader?

**URL:** <https://forums.unrealengine.com/t/how-to-serialize-with-two-decimal-places-using-fmemorywriter-fmemoryreader/2258872>\
**Category:** C++\
**Tags:** unreal-engine, CPP\
**Created:** [January 4, 2025, 6:06am UTC](https://forums.unrealengine.com/t/how-to-serialize-with-two-decimal-places-using-fmemorywriter-fmemoryreader/2258872 "2025-01-04T06:06:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [January 4, 2025, 6:06am UTC](https://forums.unrealengine.com/t/how-to-serialize-with-two-decimal-places-using-fmemorywriter-fmemoryreader/2258872/1 "2025-01-04T06:06:09Z")

</div>

I am serializing a FVector and a FRotator like this.

```auto
//----------------------------------------------------------------------------
TArray<uint8> UMovementReplicatorComponent::EncodeLocationAndRotation()
{
	TArray<uint8> Payload;
	FMemoryWriter Ar(Payload);
	Ar << Location; //FVector
	Ar << Rotation; //Rotator
	return Payload;
}
//----------------------------------------------------------------------------
void UMovementReplicatorComponent::DecodeLocationAndRotation(const TArray<uint8>& Payload)
{
	FMemoryReader Ar(Payload);
	Ar << Location; //FVector
	Ar << Rotation; //FRotator
}
//----------------------------------------------------------------------------

```

I would like to work only with two decimal places

I’m looking at the definition of FVector\_NetQuantize100 and I see that it uses FArchive instead.

 ![200](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/c/06ccee7642b395eba65aac1fbd3db18acf1cc264.png)

I need fast serialization.  
Is there a way to serialize FVector and FRotation to two decimal places from memory?

Thank you so much!!
