Bonjour,
Voici ma question, j'aimerais afficher les valeurs de seulement 4 digits avant le point et non tous les digits, comment je peux bien utiliser et convertir une valeur pour quel soit afficher comme par exemple voltage (V) = 12.5687 et Amps (A) = 2.6620?
Merci de votre aide!
Chris
ADC Read voltage?
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ADC Read voltage?
Salut chris,
En supposant que vous utilisez Flowcode 7, vous pouvez ajouter un deuxième paramètre à la fonction de conversion FloatToString.
Cela convertira en utilisant le nombre par défaut de points décimaux 6.
Cela convertira en utilisant le nombre de points décimaux surchargé 2.
Hi Chris,
Assuming you're using Flowcode 7 you can add a second parameter to the FloatToString conversion function.
This will convert using the default number of decimal points 6.
This will convert using the overridden number of decimal points 2.
En supposant que vous utilisez Flowcode 7, vous pouvez ajouter un deuxième paramètre à la fonction de conversion FloatToString.
Cela convertira en utilisant le nombre par défaut de points décimaux 6.
Code: Select all
lcdamps = FloatToString$ (Current)
Code: Select all
lcdamps = FloatToString$ (Current, 2)
Hi Chris,
Assuming you're using Flowcode 7 you can add a second parameter to the FloatToString conversion function.
This will convert using the default number of decimal points 6.
Code: Select all
lcdamps = FloatToString$ (Current)
Code: Select all
lcdamps = FloatToString$ (Current, 2)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: ADC Read voltage?
Bonjour Benj,
Oui j'utilise Flowcode v7!
Merci pour votre aide, ça fonctionne très bien!
Chris
Oui j'utilise Flowcode v7!
Merci pour votre aide, ça fonctionne très bien!
Chris