This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Transform } from 'class-transformer'; | |
import { Column, Entity } from 'typeorm'; | |
import { DecimalToString, DecimalTransformer } from './decimal.transformer'; | |
@Entity('account') | |
export class AccountEntity { | |
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0, transformer: new DecimalTransformer() }) | |
@Transform(DecimalToString(), { toPlainOnly: true }) | |
public balance: Decimal; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const DecimalToString = (decimals: number = 2) => (decimal?: Decimal) => decimal?.toFixed?.(decimals) || decimal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Column, Entity } from 'typeorm'; | |
import { DecimalTransformer } from './decimal.transformer'; | |
@Entity('account') | |
export class AccountEntity { | |
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0, transformer: new DecimalTransformer() }) | |
public balance: Decimal; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Decimal from 'decimal.js'; | |
import { ValueTransformer } from 'typeorm'; | |
export class DecimalTransformer implements ValueTransformer { | |
/** | |
* Used to marshal Decimal when writing to the database. | |
*/ | |
to(decimal?: Decimal): string | null { | |
return decimal?.toString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Column, Entity } from 'typeorm'; | |
@Entity('account') | |
export class AccountEntity { | |
@Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0.0 }) | |
public balance: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a295fa4e457ca8c72751ffb6196f34b2349dcd91443b8c70ad76082d30dbdcd9:[email protected] | |
eb128495afd6bb3b92af2769be621cae85cfe8364ddedec4f791d73c048bb54b:[email protected] | |
9a87cd73e0ca53800a5f3f1ae9ce200c59fd2207be54dfe5e0a0874c003e8155:[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a295fa4e457ca8c72751ffb6196f34b2349dcd91443b8c70ad76082d30dbdcd9 | |
eb128495afd6bb3b92af2769be621cae85cfe8364ddedec4f791d73c048bb54b | |
9a87cd73e0ca53800a5f3f1ae9ce200c59fd2207be54dfe5e0a0874c003e8155 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] | |
?l?d,?l?d._-,[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
using System.Linq; | |
public class BuildPostProcessor | |
{ | |
[PostProcessBuild] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Plugins.NativeCalculations; | |
using UnityEngine; | |
public class CallingExample : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ | |
try |